Skip to content

Setting members_can_fork_private_repositories resets organisational fork policy #1844

Open

Description

@fatbasstard

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:

  • Organisation settings and Forking looks "off" (could be related to Enterprise)
  • Is there a resource to change the forking policy of an (enterprise) organisation?

Related links:

Activity

  1. kfcampbell commented on Aug 18, 2023

    @kfcampbell
    Contributor

    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?

  2. added
    Type: Bug
    Status: Needs info
    on Aug 22, 2023
  3. moved this from 🆕 Triage to 🔥 Backlog in 🧰 Octokit Activeon Aug 22, 2023
  4. fatbasstard commented on Aug 24, 2023

    @fatbasstard
    ContributorAuthor

    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

  5. github-actions commented on May 21, 2024

    @github-actions

    👋 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!

  6. added
    Status: Stale
    on May 21, 2024
  7. fatbasstard commented on May 22, 2024

    @fatbasstard
    ContributorAuthor

    Any update on this issue?

  8. removed
    Status: Stale
    on May 23, 2024
  9. tpham-drw commented on Jul 19, 2024

    @tpham-drw

    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.

  10. minsis commented on Oct 23, 2024

    @minsis

    +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.

  11. minsis commented on Oct 23, 2024

    @minsis

    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:

    • 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=true will 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.

  12. minsis commented on Feb 3, 2025

    @minsis

    Have any of the contributors been able to investigate this issue?

  13. 4 remaining items

  14. deiga commented on Jan 18, 2026

    @deiga
    Collaborator

    @giner Thanks for finding that!

    I think there still isn't an API for Organizations to manage that setting, but at least you couldd open an Feature request for the enterprise level :)

  15. added
    Status: Blocked
    on Jan 19, 2026
  16. minsis commented on Jul 9, 2026

    @minsis

    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!

  17. removed
    Status: Blocked
    on Jul 12, 2026
  18. deiga commented on Jul 12, 2026

    @deiga
    Collaborator

    Hi @minsis,

    That's lovely to hear! I don't see a PR attached to resolve this issue though, could you link it?

  19. minsis commented on Jul 17, 2026

    @minsis

    @deiga
    For some reason it seems another issue was opened (#3363) which has the PR (#3361)

  20. deiga commented on Jul 18, 2026

    @deiga
    Collaborator

    @minsis that issue and pr are for enterprise not org

  21. removed
    Status: Needs info
    on Jul 22, 2026
  22. added theissue type on Jul 22, 2026
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

    Type: Bugr/organization_settingsvNext

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions