Skip to content

[BUG]: github_organization_setting fails with 422 when a fork policy is defined on enterprise level #2689

Description

@MariusStorhaug

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:

Image

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:

Image

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.

Activity

  1. brgsstm commented on Mar 25, 2026

    @brgsstm

    any update on this one?

  2. deiga commented on Mar 25, 2026

    @deiga
    Collaborator

    @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?

  3. added
    Type: Bug
    Status: Needs info
    on Mar 25, 2026
  4. added theissue type on Mar 25, 2026
  5. added
    Status: Blocked
    on Mar 25, 2026
  6. deiga commented on Mar 25, 2026

    @deiga
    Collaborator

    There also doesn't seem to be a REST endpoint which controls that field 🙃

  7. brgsstm commented on Mar 26, 2026

    @brgsstm

    redacted debug log attached (plan + apply).

    providers.tf

    terraform {
      required_providers {
        github = {
          source  = "integrations/github"
          version = "~> 6.11.1"
        }
      }
    }
    

    main.tf

    resource "github_organization_settings" "xxx" {
      billing_email                            = "[email protected]"
      members_can_fork_private_repositories    = false
    }
    

    Same enterprise setting as @MariusStorhaug

    terraform_debug.redacted.log

  8. deiga commented on Mar 26, 2026

    @deiga
    Collaborator

    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?

  9. removed
    Status: Blocked
    on Mar 26, 2026
  10. moved this from Backlog to In Progress in Terraform Provideron Apr 22, 2026
  11. added a commit that references this issue on May 1, 2026
    21524a1
  12. added a commit that references this issue on Jun 16, 2026
    49875ba
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: Needs infoType: Bug

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions