Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: #2543

Open
1 task done
pascalnaber opened this issue Jan 21, 2025 · 0 comments
Open
1 task done

[BUG]: #2543

pascalnaber opened this issue Jan 21, 2025 · 0 comments
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented

Comments

@pascalnaber
Copy link

pascalnaber commented Jan 21, 2025

Expected Behavior

When creating an internal repo, this works great.

But when creating an internal repo based on a template we get the following error:

Error: POST https://api.github.com/repos/xyz/xyz-template/generate: 403 You'll need a different OAuth scope to create a private repository. Please see the documentation for full details. []

The template is an internal repo as well.

The PAT used to execute this has all access rights that are possible.

Actual Behavior

When creating an internal repo based on a template. No exception should come up.

Terraform Version

Terraform 1.10.3
Github provider: 6.5.0

Affected Resource(s)

github_repository

Terraform Configuration Files

resource "github_repository" "repo" {
  name                   = "abc"
  description            = "test"
  visibility             = "internal"
  auto_init              = true
  delete_branch_on_merge = true
  has_downloads          = true

  # If we don't specify the following 4 properties, tf will see updates
  has_issues           = true
  has_projects         = true
  has_wiki             = true
  vulnerability_alerts = true
 
  content {
    owner      = "xyz"
    repository = "xyz-template"
  }  
}

Steps to Reproduce

(on a global level it's not allowed to create private repositories)

terraform apply

Debug Output

Acquiring state lock. This may take a few moments...
module.github_repo["abc"].github_repository.repo: Creating...
Error: POST https://api.github.com/repos/xyz/xyz-template/generate: 403 You'll need a different OAuth scope to create a private repository. Please see the documentation for full details. []

Panic Output

Code of Conduct

  • I agree to follow this project's Code of Conduct
@pascalnaber pascalnaber added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented
Projects
None yet
Development

No branches or pull requests

1 participant