You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG]: GitHub provider version 6.0+ fails again with "This organization does not allow private repository forking []" #3159
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
Reacted by Dennis Acar, Karolis Pocius and Daniel Brady
👋 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! 🚀
@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.
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=falsename="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" {
@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.
@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.
@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.
@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.
@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.
Activity
github-actions commentedon Feb 5, 2026
👋 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! 🚀deiga commentedon Feb 6, 2026
How does it behave if you don't set allow_forking?
dacbreakpoint commentedon Feb 6, 2026
This seems to be a regression of a previously reported and fixed issue.
For reference:
Related issue: #3097
Fix: #3094
dabrady commentedon Feb 6, 2026
@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_forkingattribute at all, and it worked fine.Today I made a change to an unrelated esource in the same TF statefile, and noticed this in the plan output:
Suddenly the
github_repositoryresource provider wanted to add theignore_vulnerability_alerts_during_readattribute (which I also do not use). And then when I applied the plan, I get this:deiga commentedon Feb 6, 2026
@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?
stevehipwell commentedon Feb 6, 2026
@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_forkingunset.stevehipwell commentedon Feb 6, 2026
@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.
stevehipwell commentedon Feb 6, 2026
@dabrady prior to v6.11.0 when importing a repo you had
ignore_vulnerability_alerts_during_readset 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.stevehipwell commentedon Feb 6, 2026
@deiga you can't have allow forking in state without actually setting it.
pidumenk commentedon Feb 6, 2026
@stevehipwell @dabrady Thanks for your answer. Removing the
allow_forkingvariable from our in-house module did resolve the issue. After encountering this problem the first time, I explicitly setallow_forking = falseat the module level to prevent users from changing it. My understanding was that if our organization does not allow forking private repositories, thenfalseshould be both the default and the only valid value.stevehipwell commentedon Feb 6, 2026
@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_forkingif 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.pidumenk commentedon Feb 7, 2026
@stevehipwell I got it! Thanks for your contribution. Then I think we can close the issue as it worked out without
allow_forkingvalue in the code.