Open sstrullmyer opened 9 months ago
Same issue here with GHES v3.13.2.
Any better workarounds than ignoring the pages configuration in the repository resource?
I suspect all that would be required here would be to not provide the cname argument to the
*/pages
endpoint if theGITHUB_BASE_URL
indicates the target is a GHES instance. If this path (or another) is amenable, I'd be happy to pursue a PR for it.
@sstrullmyer Yes please
Expected Behavior
Hello,
I have been encountering an issue making modifications to the
pages
block ofgithub_repository
resources in GitHub Enterprise Server (3.10.3).I am able to initially create a
github_repository
resource with apages
block, such as this:I expect that changing an argument, such as
build_type
, would result in the GitHub repository's configuration successfully being modified in GHES. An example valid, new Terraform configuration could beActual Behavior
The Terraform provider attempts to update the GitHub Pages configuration, but fails with a 400 error:
This results in the desired configuration not being effected. This is doubly problematic, as the tfstate associated with this block appears to be prematurely updated, anticipating a successful PUT; coupled with #1913, this can lead to additional challenges.
I've tested calling the
/api/v3/repos/.../pages
endpoint directly (outside of Terraform contexts), and can confirm that a PUT request that includes anycname
entry, including empty strings andnull
, results in the same 400 error message.I suspect all that would be required here would be to not provide the cname argument to the
*/pages
endpoint if theGITHUB_BASE_URL
indicates the target is a GHES instance. If this path (or another) is amenable, I'd be happy to pursue a PR for it.Terraform Version
Terraform v1.6.6 on windows_amd64 + provider registry.terraform.io/integrations/github v5.43.0
Affected Resource(s)
Terraform Configuration Files
Steps to Reproduce
terraform apply
on the above Terraform configuration file targeting a GitHub Enterprise Server instance via GITHUB_BASE_URL (or equivalent provider configuration)build_type
to"workflow"
terraform apply
Debug Output
Panic Output
No response
Code of Conduct