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
Describe the need
The provider currently has no support for the repository-level
pull_request_creation_policysetting, which controls who can create pull requests in a repository.I maintain a separate
github-infrarepo that manages my GitHub repositories through this provider. Because this setting is missing, that repo currently has to patch it out-of-band with acurlcall against the GitHub API during Terraform apply:github_repository.pull_request_creation_policycollaborators_onlyandallterraform_data+local-execcurl -X PATCH /repos/{owner}/{repo}call in the infra moduleThis 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
pullRequestCreationPolicyand update support.Relevant log output
Current workaround in
github-infra:Code of Conduct