Skip to content

Commit 0bab21f

Browse files
committed
fix: handle no-changes case in CHANGELOG update step
- Add check to skip commit when CHANGELOG.md has no changes - Prevents workflow failure when changelog is already up to date
1 parent 8497f34 commit 0bab21f

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,14 @@ jobs:
264264
git config user.name "github-actions[bot]"
265265
git config user.email "github-actions[bot]@users.noreply.github.com"
266266
267-
# Commit and push
268-
git add CHANGELOG.md
269-
git commit -m "chore: update CHANGELOG for $NEW_VERSION [skip ci]"
270-
git push origin main
267+
# Commit and push only if there are changes
268+
if git diff --quiet CHANGELOG.md; then
269+
echo "No changes to CHANGELOG.md, skipping commit"
270+
else
271+
git add CHANGELOG.md
272+
git commit -m "chore: update CHANGELOG for $NEW_VERSION [skip ci]"
273+
git push origin main
274+
fi
271275
272276
- name: Summary
273277
if: steps.check_release.outputs.needs_release == 'true'

0 commit comments

Comments
 (0)