Skip to content

Commit 336efef

Browse files
jluque0101Qbandev
authored andcommitted
Fix: Prevent changelog PR creation when branches are in sync
1 parent 2bfc139 commit 336efef

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

.github/scripts/update-release-changelog.sh

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,27 @@ commit_and_push_changelog() {
166166
if [[ "${previous_version_ref,,}" == "null" ]]; then
167167
commit_msg="${commit_msg} (hotfix - no test plan)"
168168
fi
169-
if ! git commit -am "${commit_msg}"; then
169+
170+
local changes_committed=false
171+
if git commit -am "${commit_msg}"; then
172+
changes_committed=true
173+
else
170174
echo "No changes detected; skipping commit."
171175
fi
172176

177+
# Check if there are any differences between the changelog branch and release branch
178+
if ! ${changes_committed}; then
179+
echo "Checking for differences between ${changelog_branch} and ${release_branch}.."
180+
if ! git diff --quiet "origin/${release_branch}" "HEAD"; then
181+
echo "Differences found between branches; proceeding with PR creation."
182+
else
183+
echo "No differences between ${changelog_branch} and ${release_branch}."
184+
echo "Branches are already in sync; skipping PR creation."
185+
echo "Changelog workflow completed successfully (no updates needed)."
186+
return 0
187+
fi
188+
fi
189+
173190
local pr_body="This PR updates the change log for ${version}."
174191
if [[ "${previous_version_ref,,}" == "null" ]]; then
175192
pr_body="${pr_body} (Hotfix - no test plan generated.)"

0 commit comments

Comments
 (0)