terraform-provider-github
terraform-provider-github copied to clipboard
feat: automatic branch creation for resource 'github_repository_file'
Resolves #2101
Before the change?
- Currently repository_file does not support automatic creation of branches. This means in order manage files via pull requests (rather than directly pushing to the branch ie. main), a branch would need created. This has impacts on terraform lifecycle post-creation ie. a pull request merging the branch and deleting it, in which the branch would attempt to be re-created causing a long-lived branch to exist in a repo.
After the change?
- When the flag
autocreate_branchis set true, if the branch does not already exist then it shall be created based onautocreate_branch_source_shaorautocreate_branch_source_branchwhich defaults to main during create, update or destroy. Given the branch could be ephemeral; on reads, if the branch does not exist then content shall be read from autocreate_branch_source_branch as it may been merged.
Pull request checklist
- [x] Tests for the changes have been added (for bug fixes / features)
- [x] Docs have been reviewed and added / updated if needed (for bug fixes / features)
Does this introduce a breaking change?
Please see our docs on breaking changes to help!
- [ ] Yes
- [x] No
@wparr-circle there's a pretty quick go fmt issue to resolve here, then I can get this merged and released.
@kfcampbell applied go fmt changes now. Thanks