Closed bimlendu closed 6 months ago
And looks like visibility
is not a valid parameter in POST /user/repos API.
visibility
is allowed for creating organization repos though.
https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#create-an-organization-repository
But removing visibility
and using private
attrbiute in terraform results in a deprecation warning. Even though I am creating a personal repo.
╷
│ Warning: "private": [DEPRECATED] use visibility instead
│
│ with github_repository.private,
│ on main.tf line 1, in resource "github_repository" "private":
│ 1: resource "github_repository" "private" {
│
│ (and one more similar warning elsewhere)
Not sure if it's the same, but I ran into this issue when using the "Fine-grained personal access tokens (beta)" with this provider. As described on the GitHub docs (Creating a personal access token), they don't support creating a repository for the authenticated user.
Switching to use a PAT created with "Personal access tokens (classic)" fixed the issue for me (even when using the visibility
parameter). Hope that helps.
Oh, this is interesting! I've also run into obnoxious situations where the beta fine-grained tokens don't work...hopefully those get full support soon.
👋 Hey Friends, this issue has been automatically marked as stale
because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned
label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!
With the following terraform files, resource
github_repository.private
fails to create with 500 error.Init logs
Plan output
Apply output
Directly calling the github API with the minimal payload works as expected and the repo gets created.