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_organization_setting fails with 422 when a fork policy is defined on enterprise level #2689
The reconfiguration of a organization setting resource fails with the following changes when we have a policy defining a forking policy on enterprise level:
Policy:
Deployment output:
╷
│ Error: PATCH https://mydomain.ghe.com/api/v3/orgs/dnb-acme: 422 []
│
│ with module.organization-settings.github_organization_settings.this,
│ on .terraform/modules/organization-settings/main.settings.tf line 1, in resource "github_organization_settings" "this":
│ 1: resource "github_organization_settings" "this" {
│
╵
Upon disabling the forking setting on the organization, the deployment succeeds:
Logs from deployment are clean and green.
After first deployment i set the fork settings on organization same as the enterprise policy and rerun tf apply and no issues arrise on the second run.
Reacted by Marta Meek, Diego Vazquez Nanini, Carl Smedstad and Tom Burgess
@brgsstm@MariusStorhaug If you are encountering this with the latest provider version, could you please share a DEBUG level output of terraform apply and a sample Terraform config to reproduce this?
Fudge. We don't have modernized logging for github_organization_setting
Could you manually run this GET against the GH API and share the redacted output?
And I'm beginning to realize the situation now.
The setting is enforced on Enterprise level, right? Which understandably would then block any changes on the Org level to the same policy.
What is the behaviour you would expect in this situation?
Activity
brgsstm commentedon Mar 25, 2026
any update on this one?
deiga commentedon Mar 25, 2026
@brgsstm @MariusStorhaug If you are encountering this with the latest provider version, could you please share a DEBUG level output of
terraform applyand a sample Terraform config to reproduce this?deiga commentedon Mar 25, 2026
There also doesn't seem to be a REST endpoint which controls that field 🙃
brgsstm commentedon Mar 26, 2026
redacted debug log attached (plan + apply).
providers.tf
main.tf
Same enterprise setting as @MariusStorhaug
terraform_debug.redacted.log
deiga commentedon Mar 26, 2026
Fudge. We don't have modernized logging for
github_organization_settingCould you manually run this GET against the GH API and share the redacted output?
And I'm beginning to realize the situation now.
The setting is enforced on Enterprise level, right? Which understandably would then block any changes on the Org level to the same policy.
What is the behaviour you would expect in this situation?
fix: avoid 422 when enterprise policy controls org fork setting
fix: avoid 422 when enterprise policy controls org fork setting