integrations / integrations/terraform-provider-github

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

Open
#2,689 5 comments 4 reactions 0 assignees View on GitHub
Status: Needs info Type: Bug
Dominant language
Go
Stars
1.2k
Forks
1k
Avg merge
1d 14h
Merged PRs (30d)
8

Description

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](https://github.com/user-attachments/assets/2dcbe241-2b21-4c38-9523-05d410ef7563)

Deployment output:
```plaintext

│ 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](https://github.com/user-attachments/assets/d7c89103-4435-454e-bb55-80dbf5afa74f)

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.