Skip to content

feat: Add pull request settings to github_repository#3479

Draft
nicolas-grekas wants to merge 2 commits into
integrations:mainfrom
nicolas-grekas:feat/repository-pull-request-settings
Draft

feat: Add pull request settings to github_repository#3479
nicolas-grekas wants to merge 2 commits into
integrations:mainfrom
nicolas-grekas:feat/repository-pull-request-settings

Conversation

@nicolas-grekas
Copy link
Copy Markdown

Resolves #3198


Before the change?

github_repository could not manage the repository pull request settings GitHub shipped in February 2026: disabling pull requests entirely, and restricting who can open them.

After the change?

Two new arguments on github_repository (and read-only attributes on the github_repository data source):

  • has_pull_requests (bool, defaults to true) — set to false to disable pull requests on the repository.
  • pull_request_creation_policy (all / collaborators_only) — restricts who can open pull requests.

has_pull_requests defaults to true so existing repositories keep pull requests enabled rather than being silently disabled on the next apply. pull_request_creation_policy is only sent when pull requests are enabled, mirroring how the existing merge_commit_* / squash_merge_commit_* arguments are gated on their parent toggle.

Important

Blocked on a go-github release. The struct fields land in google/go-github#4268, which merged after v88.0.0. go.mod currently pins a master pseudo-version so the code compiles; it must be repointed to the eventual v89 release before this can merge. This matches the issue's existing Blocked status.

Pull request checklist

  • Schema migrations have been created if needed (none needed — additive optional fields)
  • 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?

  • Yes
  • No

The has_pull_requests and pull_request_creation_policy fields were added
to go-github's Repository struct after the v88.0.0 release. Pin to the
master pseudo-version until v89 is tagged.
GitHub added two repository settings in February 2026: disabling pull
requests entirely (has_pull_requests) and restricting who can open them
(pull_request_creation_policy, "all" or "collaborators_only").

has_pull_requests defaults to true so existing repositories keep pull
requests enabled. The creation policy is only sent when pull requests are
enabled, matching how the merge-commit title/message fields are handled.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 6, 2026

👋 Hi, and thank you for this contribution!

This repo is maintained by GitHub and community members on a best-effort basis. We'll get to this as soon as we can.

You can help us prioritize by joining the discussion on open issues and PRs, sharing details on the changes you need, and reviewing other contributions.


🤖 This is an automated message.

@github-actions github-actions Bot added the Type: Feature New feature or request label Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT]: New Pull Request settings for Repositories

1 participant