Skip to content

[FEAT]: Support has_pull_requests and pull_request_creation_policy on github_repository #3472

Closed

Description

@ap-1

Describe the need

Please add two attributes to the github_repository resource (and the matching data source):

  • has_pull_requests (bool, default true): toggles the repository's Pull requests feature on/off, mirroring the existing has_issues / has_wiki / has_projects / has_discussions attributes
  • pull_request_creation_policy (string, all | collaborators_only): the "Creation allowed by" setting that controls who may open PRs.

Both already exist on the repository object returned by the REST API (PATCH /repos/{owner}/{repo} accepts has_pull_requests and persists it); there is currently no way to manage them through the provider.

Note: this is blocked by google/go-github#4268

GitHub Installation Type

  • GitHub.com (Free, Pro, or Team)
  • GitHub Enterprise Server (on-premises)
  • GitHub Enterprise Cloud with Personal Accounts (github.com)
  • GitHub Enterprise Cloud with Managed Users/EMU (github.com)
  • GitHub Enterprise Cloud with Data Residency (*.ghe.com)
  • I don't know

Relevant log output

$ curl -s -H "Authorization: Bearer $TOKEN" -H "Accept: application/vnd.github+json"
    https://api.github.com/repos/OWNER/REPO | jq '{has_pull_requests, pull_request_creation_policy}'
{
  "has_pull_requests": true,
  "pull_request_creation_policy": "all"
}

$ curl -s -o /dev/null -w '%{http_code}\n' -X PATCH
    -H "Authorization: Bearer $TOKEN" -H "Accept: application/vnd.github+json"
    https://api.github.com/repos/OWNER/REPO -d '{"has_pull_requests": false}'
200

$ curl -s -H "Authorization: Bearer $TOKEN" -H "Accept: application/vnd.github+json"
    https://api.github.com/repos/OWNER/REPO | jq '{has_pull_requests, pull_request_creation_policy}'
{
  "has_pull_requests": false,
  "pull_request_creation_policy": "all"
}

Code of Conduct

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

Activity

  1. github-actions commented on Jun 3, 2026

    @github-actions

    👋 Hi, and thank you for opening this issue!

    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 adding details, reproduction steps, or a 👍 to issues that matter to you, and by joining the discussion on open issues and PRs.


    🤖 This is an automated message.

  2. ap-1 commented on Jun 15, 2026

    @ap-1
    Author

    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

    Labels

    Status: TriageThis is being looked at and prioritizedType: FeatureNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions