Skip to content

fix(github_repository_file): Commit detail changes should not do empty commits #2638

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

Closed
wants to merge 1 commit into from

Conversation

atorrescogollo
Copy link

When terraform changes any field related to how commits are done (email, commit message, etc), it pushes an unexpected empty commit to the repo.

This is specially relevant when importing an existing file into terraform, where the commit message you put in terraform will likely be different from the commit that pushed the file originally. In that sense, importing a file will always mean eventually doing empty commits for each file you imported.

The expected behaviour is just updating the state and avoid doing those empty commits. Otherwise, each empty commit can run any CI that might be configured, notifications, etc.

Resolves #689


Before the change?

  • When any of commit_sha, commit_author, commit_email or commit_message changed, it did a empty commit

After the change?

  • Now, it checks which fields have changes and only commits if there are changes in any other field

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

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