Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: automatic branch creation for resource 'github_repository_file' #2100

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

wparr-circle
Copy link

@wparr-circle wparr-circle commented Jan 15, 2024

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_branch is set true, if the branch does not already exist then it shall be created based on autocreate_branch_source_sha or autocreate_branch_source_branch which 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

  • Tests for the changes have been added (for bug fixes / features)
  • 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
  • No

@wparr-circle wparr-circle changed the title feat: support automatic branch creation for resource 'github_reposito… feat: automatic branch creation for resource 'github_repository_file' Jan 15, 2024
@kfcampbell
Copy link
Member

@wparr-circle there's a pretty quick go fmt issue to resolve here, then I can get this merged and released.

@wparr-circle
Copy link
Author

@kfcampbell applied go fmt changes now. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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