integrations / terraform-provider-github

Terraform GitHub provider
https://www.terraform.io/docs/providers/github/
MIT License
891 stars 736 forks source link

Setting members_can_fork_private_repositories resets organisational fork policy #1844

Open fatbasstard opened 1 year ago

fatbasstard commented 1 year ago

We're now using the github_organization_settings to configure some organisational settings (instead of "manual") and we noticed that settings members_can_fork_private_repositories works in unexpected ways with the organisational settings:

image

We had forking set to User accounts, imported the github_organization_settings resource (where members_can_fork_private_repositories apparantly is set to True and not TF changes this to the "Default" Organisations within this enterprise.

This is quite unexpected behaviour, and after reading up other issues decided to remove this setting from the resource entirely. When removing it TF actually said it would change the setting (update members_can_fork_private_repositories : true change to false). But the setting is now kept intact.

So:

Related links:

kfcampbell commented 1 year ago

I'm sorry, I'm not quite sure what you mean by:

This is quite unexpected behaviour, and after reading up other issues decided to remove this setting from the resource entirely. When removing it TF actually said it would change the setting (update members_can_fork_private_repositories : true change to false). But the setting is now kept intact.

Would you mind rephrasing this for me a little differently and I can try to help troubleshoot?

fatbasstard commented 1 year ago

Hi @kfcampbell,

Organisation setting in the GUI:

image

Applying Terraform with the following (which gives no changes):

resource "github_organization_settings" "connectedbrewery" {
...
  members_can_fork_private_repositories = true
...
}

image

github-actions[bot] commented 4 months ago

👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

fatbasstard commented 4 months ago

Any update on this issue?

tpham-drw commented 2 months ago

We use github_organization_settings with members_can_fork_private_repositories ~but are not seeing the sub-setting for the fork destination being reset by Terraform~ I spoke too soon - if the TF apply touches github_organization_settings, even though the change is not shown in the plan, it will reset the settings.

It would be good to be able to set this in TF instead of manually though.