Skip to content

fix: Restrict allow_forking to org-owned repositories only - #3100

Closed
smur89 wants to merge 1 commit into
integrations:mainfrom
smur89:fix/allow-forking-org-only
Closed

smur89 wants to merge 1 commit into
integrations:mainfrom
smur89:fix/allow-forking-org-only

Conversation

@smur89

@smur89 smur89 commented Jan 20, 2026

Copy link
Copy Markdown

The allow_forking field should only be set for org-owned repositories.

GitHub API returns 422 error when this field is included in requests for private user-owned repositories.

Resolves #3088


Before the change?

Screenshot 2026-01-20 at 18 27 22

After the change?

Pull request checklist

  • Schema migrations have been created if needed (example)
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes
  • No

The allow_forking field should only be set for org-owned repositories.
      GitHub API returns 422 error when this field is included in requests for
      private user-owned repositories.
@github-actions github-actions Bot added the Type: Bug Something isn't working as documented label Jan 20, 2026
@github-actions

Copy link
Copy Markdown

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@smur89 smur89 changed the title ix: Restrict allow_forking to org-owned repositories only fix: Restrict allow_forking to org-owned repositories only Jan 20, 2026
@stevehipwell

Copy link
Copy Markdown
Collaborator

@smur89 #3088 is already fixed by #3094.

@smur89

smur89 commented Jan 21, 2026

Copy link
Copy Markdown
Author

@smur89 #3088 is already fixed by #3094.

@stevehipwell that fix is not handling private user-owned repositories, which is the issue I ran in to

@stevehipwell

Copy link
Copy Markdown
Collaborator

@smur I'm not sure how it's not handling user-owned repositories given that if you don't set the new allow_forking attribute it's a no-op over previous versions?

If this is broken for you then please open a new issue with the full details.

@pasdam

pasdam commented Feb 21, 2026 •

Copy link
Copy Markdown

I'm not sure it's related, I'm just reporting it here in case it helps others: I'm using the version 6.10.2 and I was getting the same error while setting allow_auto_merge = true on my own private repo, not part of any org, and I wasn't setting any forking config.

That feature is not available for private repos, so setting that to false solved the issue for me.

I guess the error was coming directly from Github, but it was misleading.

@stevehipwell

Copy link
Copy Markdown
Collaborator

@pasdam the allow_forking implementation is correct as of the v6.11.1 release and the documentation covers the fact that this is for organization repositories.

@pasdam

pasdam commented Feb 23, 2026

Copy link
Copy Markdown

Sorry, I guess I wasn't clear: I was just suggesting that in my case the error was not related to allow_forking, which I wasn't using at all, event though the message was pointing me in that direction, but rather the fact I was using allow_auto_merge = true on a private personal repo, which is not allowed.

The error is misleading, and I guess it's coming from GitHub API directly, not from the terraform provider, but I might be wrong about that. Anyway if I find the time I'll test the latest version to see if that fixes my issue as well.

I was just posting here in case some other folks would come here having the same issue I was facing.

@stevehipwell

Copy link
Copy Markdown
Collaborator

@pasdam as you didn't provide an example of what you were seeing or how it related to forking I don't see how you're adding any value here? Also you're not on the latest version, or the version that fixes allow_forking, so your comment is at best stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Bug Something isn't working as documented

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: allow_forking option breaks repo creation when the org doesn't allow forking

3 participants