integrations / terraform-provider-github

Terraform GitHub provider
https://www.terraform.io/docs/providers/github/
MIT License
905 stars 746 forks source link

[FEAT]: github_repository_file should support automatic branch creation if the ref does not exist #2101

Closed wparr-circle closed 3 months ago

wparr-circle commented 9 months ago

Describe the need

The resource github_repository_file does not currently support automatic branch creation. For example, a potential use case is rather than directly writing changes to a long lived branch such as master/main writing to a short lived ephemeral branch to ultimately be reviewed and merged via a pull request. It's not possible to do this gracefully without supporting automatic branch creation given if we leveraged the github_branch resource, terraform would continue to recreate the branch after it's deleted in Github (either on deletion of stale branches, or immediate deletion of the branch following a merged pull request).

SDK Version

No response

API Version

No response

Relevant log output

No response

Code of Conduct

nickfloyd commented 9 months ago

Hey @wparr-circle thanks for letting us know about this need! ❤️ Let us know if you'd be interested coming up with a way to address it and then submitting a PR to be reviewed. For now I have labeled this as "Up For Grabs" so that the community knows that it's available as well.