-
-
Notifications
You must be signed in to change notification settings - Fork 4
Fix: Prevent changelog PR creation when branches are in sync #177
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -166,10 +166,27 @@ commit_and_push_changelog() { | |
| if [[ "${previous_version_ref,,}" == "null" ]]; then | ||
| commit_msg="${commit_msg} (hotfix - no test plan)" | ||
| fi | ||
| if ! git commit -am "${commit_msg}"; then | ||
|
|
||
| local changes_committed=false | ||
| if git commit -am "${commit_msg}"; then | ||
| changes_committed=true | ||
| else | ||
| echo "No changes detected; skipping commit." | ||
| fi | ||
|
|
||
| # Check if there are any differences between the changelog branch and release branch | ||
| if ! ${changes_committed}; then | ||
| echo "Checking for differences between ${changelog_branch} and ${release_branch}.." | ||
| if ! git diff --quiet "origin/${release_branch}" "HEAD"; then | ||
| echo "Differences found between branches; proceeding with PR creation." | ||
| else | ||
| echo "No differences between ${changelog_branch} and ${release_branch}." | ||
| echo "Branches are already in sync; skipping PR creation." | ||
| echo "Changelog workflow completed successfully (no updates needed)." | ||
| return 0 | ||
| fi | ||
| fi | ||
|
Comment on lines
+177
to
+188
|
||
|
|
||
| local pr_body="This PR updates the change log for ${version}." | ||
| if [[ "${previous_version_ref,,}" == "null" ]]; then | ||
| pr_body="${pr_body} (Hotfix - no test plan generated.)" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The comment could be more descriptive about the purpose of this check. Consider updating it to:
This makes it clearer why we're performing this check only when
changes_committedis false.