Skip to content
New issue

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

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

Already on GitHub? # to your account

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

Merged
merged 7 commits into from
Aug 6, 2024

Conversation

wparr-circle
Copy link
Contributor

@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
Contributor Author

@kfcampbell applied go fmt changes now. Thanks

Copy link
Contributor

@nickfloyd nickfloyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey thanks for the contributions here! ❤️

@nickfloyd nickfloyd merged commit e6660d4 into integrations:main Aug 6, 2024
3 checks passed
# for free to join this conversation on GitHub. Already have an account? # 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
3 participants