Skip to content

[FEAT]: support pull_request_creation_policy on github_repository #3348

Open

Description

@RoFz

Describe the need

The provider currently has no support for the repository-level pull_request_creation_policy setting, which controls who can create pull requests in a repository.

I maintain a separate github-infra repo that manages my GitHub repositories through this provider. Because this setting is missing, that repo currently has to patch it out-of-band with a curl call against the GitHub API during Terraform apply:

  • desired Terraform surface: github_repository.pull_request_creation_policy
  • values currently in use: collaborators_only and all
  • current workaround: a local terraform_data + local-exec curl -X PATCH /repos/{owner}/{repo} call in the infra module

This means the repository resource cannot fully express the repo settings being managed, and the workaround has to exist outside normal provider state handling.

SDK Version

terraform-provider-github (current main branch)

API Version

GitHub REST API 2022-11-28 in the current workaround; GitHub GraphQL also exposes pullRequestCreationPolicy and update support.

Relevant log output

Current workaround in github-infra:

curl -s -f \
  -X PATCH \
  -H "Authorization: Bearer $GITHUB_TOKEN" \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  "https://api.github.com/repos/${var.owner}/${var.name}" \
  -d '{"pull_request_creation_policy":"${var.pull_request_creation_policy}"}'

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. github-actions commented on Apr 19, 2026

    @github-actions

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

  2. added this to the milestone on Apr 19, 2026
  3. removed this from the milestone on Apr 19, 2026
  4. RoFz commented on Apr 19, 2026

    @RoFz
    Author

    Implemented in PR #3349

  5. usmonster commented on Jul 31, 2026

    @usmonster
    Contributor

    Duplicate of #3198?

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions