Repository navigation
Description
Expected Behavior
When an organization has custom properties marked as required = true (via github_organization_custom_properties), it should be possible to create a repository with github_repository and provide the required property values during the same terraform apply. This aligns with GitHub's documented organization setting "Require this property for all repositories": https://docs.github.com/en/organizations/managing-organization-settings/managing-custom-properties-for-repositories-in-your-organization#setting-values-for-repositories-in-your-organization.
Actual Behavior
Repository creation fails because required custom properties cannot be provided in the github_repository resource at create time.
Current flow creates a chicken-and-egg problem:
github_repositorydoes not expose an argument/block to set custom property values during create.github_repository_custom_propertyrequires an existing repository (repositoryargument).- If org policy enforces required properties on creation, GitHub API rejects repository creation before
github_repository_custom_propertycan run.
As a result, there is no valid Terraform path to create a new repository under that policy.
Terraform Version
Terraform v1.11.x
provider registry.terraform.io/integrations/github v6.6.0+
Affected Resource(s)
github_repositorygithub_repository_custom_property
Terraform Configuration Files
resource "github_organization_custom_properties" "environment" {
property_name = "environment"
value_type = "single_select"
required = true
allowed_values = ["development", "staging", "production"]
}
resource "github_repository" "my_repo" {
name = "my-new-repo"
description = "A new repository"
visibility = "private"
auto_init = true
# No field currently exists to set required custom property values here
}
resource "github_repository_custom_property" "my_repo_env" {
repository = github_repository.my_repo.name
property_name = "environment"
property_type = "single_select"
property_value = ["production"]
}Steps to Reproduce
- Define an organization custom property with
required = true. - Attempt to create a new repository using
github_repository. - Run
terraform apply. - Observe repository create failing because required custom property value is missing.
Debug Output
Error: POST https://api.github.com/orgs/{org}/repos: 422 Validation Failed
Required custom property 'environment' is missing.Panic Output
N/A
Code of Conduct
- I agree to follow this project's Code of Conduct
Activity
github-actions commentedon Mar 24, 2026
👋 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! 🚀feat: Add custom_properties to github_repository and github_enterpris…
feat: Add custom_properties to github_repository and github_enterpris…
feat: Add custom_properties to github_repository and github_enterpris…
feat: Add custom_properties to github_repository and github_enterpris…
feat: Add custom_properties to github_repository and github_enterpris…
mbansal86 commentedon Aug 19, 2026
Hello Team, kindly request that you prioritize this issue, as it is impacting me as well and appears to be affecting many users. Your prompt attention and support in resolving this issue would be greatly appreciated.
deiga commentedon Aug 19, 2026
@mbansal86 We will take a look at this when there is capacity for it. We're volunteers doing this as a hobby.
If you want to influence priorities you should contact your GitHub sales representative and ask them if this issue can be prioritised
alexhumphreys commentedon Sep 17, 2026
I'd like to pick this up. I'd propose a repeated
custom_propertyblock ongithub_repository(same fields asgithub_repository_custom_property) that's sent in the create request, with the provider only managing the property names declared in config. That should handle multi_select and avoids perpetual diffs from org default values, I think the map approach in #3322 might run into issues there. Happy to adjust if you'd prefer a different shape.cc @faradayfan, since this overlaps with #3322. Not trying to step on that work, happy to coordinate.
deiga commentedon Sep 17, 2026
@alexhumphreys lovely to see you're eager 🤩
We want to reduce the amount of configuration inside the github_repository resource, so you're suggested direction isn't ideal.
I also think that repo custom properties are a separate API endpoint from repo CRUD, putting that in conflict with ARCHITECTURE.md
dtkachenko-bai commentedon Oct 20, 2026
This affects us. And I'm in favor of proposed solution.
rankin-tr commentedon Nov 13, 2026
This is a pain for my organization. The web UI is able to handle this gracefully. Id love to see feature parity with Terraform.
I've pinged my rep a few times. How can we gain some traction here?