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
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:
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:
Organisation settings and Forking looks "off" (could be related to Enterprise)
Is there a resource to change the forking policy of an (enterprise) organisation?
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?
👋 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!
We use github_organization_settings with members_can_fork_private_repositoriesbut 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.
+1 on this. Its less about being a bug and more about needing to add the feature of being able to select which rule to apply for forking private repos.
I also tested some other scenarios directly on the API and here is what I've found so far:
Submitting only members_can_fork_private_repositories=false results expected behavior of disabling said property
Submitting only members_can_fork_private_repositories=true when previous setting was false will enable said property with the first option selected.
Submitting only members_can_fork_private_repositories=true when already set to true will reset the property back to the first option, regardless of what it was previously.
Submitting any other property by itself (I used default_repository_permission=write) while members_can_fork_private_repositories=true AND selected any other option will not change the options selected for members_can_fork_private_repositories
Submitting any other property (I used default_repository_permission=write) AND members_can_fork_private_repositories=truewill reset the property back to the first option, regardless of what it was previously.
So, without really digging into the code (because I suck at go), my assumption is that the provider is redundantly submitting members_can_fork_private_repositories: true regardless of changes to said property defined in the template.
I guess maybe the work around might be to exclude submitting this property if its already set to true, and only submit if it is changing from false to true.
Also, maybe creating a feature request or something to GitHub to update the management of this property, not sure how that is actually done. I am an enterprise customer so if I can help make this request, I'd be happy to.
Hi @deiga! It would seem this has now been added to the API. There is a PR attached to this issue, but its pending workflow approvals. Would you kindly be able to run these workflows?
Activity
kfcampbell commentedon Aug 18, 2023
I'm sorry, I'm not quite sure what you mean by:
Would you mind rephrasing this for me a little differently and I can try to help troubleshoot?
fatbasstard commentedon Aug 24, 2023
Hi @kfcampbell,
Organisation setting in the GUI:
Applying Terraform with the following (which gives no changes):
github-actions commentedon May 21, 2024
👋 Hey Friends, this issue has been automatically marked as
stalebecause it has no recent activity. It will be closed if no further activity occurs. Please add theStatus: Pinnedlabel if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!fatbasstard commentedon May 22, 2024
Any update on this issue?
tpham-drw commentedon Jul 19, 2024
We use
github_organization_settingswithmembers_can_fork_private_repositoriesbut are not seeing the sub-setting for the fork destination being reset by TerraformI spoke too soon - if the TF apply touchesgithub_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.
minsis commentedon Oct 23, 2024
+1 on this. Its less about being a bug and more about needing to add the feature of being able to select which rule to apply for forking private repos.
minsis commentedon Oct 23, 2024
Also wanted to mention I took a quick look at the GitHub API and I don't see any field that actually sets the forking rule when enabling
members_can_fork_private_repositories. So, this could end up being a limitation on the GitHub API.https://docs.github.com/en/rest/orgs/orgs?apiVersion=2022-11-28#update-an-organization
I also tested some other scenarios directly on the API and here is what I've found so far:
members_can_fork_private_repositories=falseresults expected behavior of disabling said propertymembers_can_fork_private_repositories=truewhen previous setting was false will enable said property with the first option selected.members_can_fork_private_repositories=truewhen already set to true will reset the property back to the first option, regardless of what it was previously.default_repository_permission=write) whilemembers_can_fork_private_repositories=trueAND selected any other option will not change the options selected formembers_can_fork_private_repositoriesdefault_repository_permission=write) ANDmembers_can_fork_private_repositories=truewill reset the property back to the first option, regardless of what it was previously.So, without really digging into the code (because I suck at go), my assumption is that the provider is redundantly submitting
members_can_fork_private_repositories: trueregardless of changes to said property defined in the template.I guess maybe the work around might be to exclude submitting this property if its already set to
true, and only submit if it is changing fromfalsetotrue.Also, maybe creating a feature request or something to GitHub to update the management of this property, not sure how that is actually done. I am an enterprise customer so if I can help make this request, I'd be happy to.
minsis commentedon Feb 3, 2025
Have any of the contributors been able to investigate this issue?
4 remaining items
deiga commentedon Jan 18, 2026
@giner Thanks for finding that!
I think there still isn't an API for
Organizationsto manage that setting, but at least you couldd open an Feature request for the enterprise level :)feat: add github_enterprise_private_repository_forking_setting resource
minsis commentedon Jul 9, 2026
Hi @deiga! It would seem this has now been added to the API. There is a PR attached to this issue, but its pending workflow approvals. Would you kindly be able to run these workflows?
Thanks!
deiga commentedon Jul 12, 2026
Hi @minsis,
That's lovely to hear! I don't see a PR attached to resolve this issue though, could you link it?
minsis commentedon Jul 17, 2026
@deiga
For some reason it seems another issue was opened (#3363) which has the PR (#3361)
deiga commentedon Jul 18, 2026
@minsis that issue and pr are for enterprise not org