Skip to content

[BUG]: GitHub provider version 6.0+ fails again with "This organization does not allow private repository forking []" #3159

Closed

Description

@pidumenk

Expected Behavior

I noticed that new versions (v6.11.0) were released around 12 hours ago. With this release, the old issue “This organization does not allow private repository forking” - has resurfaced.

The expected behavior is that this error should not occur when allow_forking is set to false.

Actual Behavior

However, even using 6.11.0 provider versions, the error still occurs, despite the fact that allow_forking explicitly set to false.

Error: PATCH https://api.github.com/repos/<ORGANIZATION>/partner-price-komparator: 422 This organization does not allow private repository forking []

  with module.github_repository["partner-price-komparator"].github_repository.this,
  on src/main.tf line 1, in resource "github_repository" "this":
   1: resource "github_repository" "this" {

Error: PATCH https://api.github.com/repos/<ORGANIZATION>/litellm-oidc-proxy: 422 This organization does not allow private repository forking []

  with module.github_repository["litellm-oidc-proxy"].github_repository.this,
  on src/main.tf line 1, in resource "github_repository" "this":
   1: resource "github_repository" "this" {

It blocks us from propagating changes to GitHub repositories during the Terraform apply steps.

  # module.github_repository["partner-price-komparator"].github_repository.this will be created
  + resource "github_repository" "this" {
      + allow_auto_merge       = false
      + allow_forking          = false
      + allow_merge_commit     = true
      + allow_rebase_merge     = true
      + allow_squash_merge     = true

Terraform Version

Terrafrom v1.14.3
on linux_amd64
provider registry.terraform.io/integrations/github v6.0+

Affected Resource(s)

  • github_repository

Terraform Configuration Files

Steps to Reproduce

Set the GitHub provider version to 6.0+ and allow_forking option to false.
Run terraform plan on an existing github_repository configuration.
Run terraform apply.

Debug Output

Panic Output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added
    Type: Bug
    Status: Triage
    on Feb 5, 2026
  2. github-actions commented on Feb 5, 2026

    @github-actions

    👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

  3. deiga commented on Feb 6, 2026

    @deiga
    Collaborator

    How does it behave if you don't set allow_forking?

  4. dacbreakpoint commented on Feb 6, 2026

    @dacbreakpoint

    This seems to be a regression of a previously reported and fixed issue.

    For reference:
    Related issue: #3097
    Fix: #3094

  5. dabrady commented on Feb 6, 2026

    @dabrady

    @deiga It behaves the same way. Yesterday I imported a newly created private repo with some bare minimum config and didn't specify the allow_forking attribute at all, and it worked fine.

    resource "github_repository" "this" {
      name         = var.name
      description  = var.description
      visibility   = "private"
    }

    Today I made a change to an unrelated esource in the same TF statefile, and noticed this in the plan output:

    # module.my-private-repo.github_repository.this will be updated in-place
      ~ resource "github_repository" "this" {
            id                                      = "my-private-repo"
          + ignore_vulnerability_alerts_during_read = false
            name                                    = "my-private-repo"
            # (40 unchanged attributes hidden)
    
            # (1 unchanged block hidden)
        }

    Suddenly the github_repository resource provider wanted to add the ignore_vulnerability_alerts_during_read attribute (which I also do not use). And then when I applied the plan, I get this:

    Error: PATCH https://api.github.com/repos/<redacted>: 422 This organization does not allow private repository forking []
    
      with module.my-private-repo.github_repository.this,
      on .terraform/modules/my-private-repo/modules/github-repository/main.tf line 2,
      in resource "github_repository" "this":
       2: resource "github_repository" "this" {
    
  6. deiga commented on Feb 6, 2026

    @deiga
    Collaborator

    @stevehipwell this makes me wonder if we should have had a state migration that removes allow_forking from state if it wasn't explicitly set?

  7. stevehipwell commented on Feb 6, 2026

    @stevehipwell
    Collaborator

    @pidumenk we fixed the root cause of the issue, so unless you actually want to control forking at the repo level (which is not supported if the org has blocked it) you need to leave allow_forking unset.

  8. stevehipwell commented on Feb 6, 2026

    @stevehipwell
    Collaborator

    @dacbreakpoint #3094 wasn't correct as it wouldn't ever allow forking to be disabled. The change in #3127 works as expected where forking is only configured when explicitly set.

  9. stevehipwell commented on Feb 6, 2026

    @stevehipwell
    Collaborator

    @dabrady prior to v6.11.0 when importing a repo you had ignore_vulnerability_alerts_during_read set to true, if you'd applied again with the previous version you'd have seen the same diff. The fact that you don't have forking configured and got that error suggests to me that you're either not actually on v6.11.0 or you have set forking explicitly.

  10. stevehipwell commented on Feb 6, 2026

    @stevehipwell
    Collaborator

    @deiga you can't have allow forking in state without actually setting it.

  11. pidumenk commented on Feb 6, 2026

    @pidumenk
    Author

    @stevehipwell @dabrady Thanks for your answer. Removing the allow_forking variable from our in-house module did resolve the issue. After encountering this problem the first time, I explicitly set allow_forking = false at the module level to prevent users from changing it. My understanding was that if our organization does not allow forking private repositories, then false should be both the default and the only valid value.

  12. stevehipwell commented on Feb 6, 2026

    @stevehipwell
    Collaborator

    @pidumenk the original implementation had issues and never worked, mainly because the resource API design wasn't quite right. The current design, only set allow_forking if you want to manage it, is the only way this is possible to model given that GitHub only lets you set the value if the org hasn't blocked forking.

  13. pidumenk commented on Feb 7, 2026

    @pidumenk
    Author

    @stevehipwell I got it! Thanks for your contribution. Then I think we can close the issue as it worked out without allow_forking value in the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageType: Bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions