Skip to content

Commit d5a6f8f

Browse files
committed
fix: handle case where Cargo.toml version is already correct in release workflow
1 parent ab0f430 commit d5a6f8f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,14 @@ jobs:
7676
git config --local user.email "action@github.com"
7777
git config --local user.name "GitHub Action"
7878
git add Cargo.toml
79-
git commit -m "Bump version to ${{ steps.version.outputs.version }}"
80-
git push origin main
79+
80+
# Only commit if there are changes
81+
if git diff --staged --quiet; then
82+
echo "No changes to commit - Cargo.toml already at correct version"
83+
else
84+
git commit -m "Bump version to ${{ steps.version.outputs.version }}"
85+
git push origin main
86+
fi
8187
8288
- name: Create git tag
8389
if: steps.tag-check.outputs.exists == 'false'

0 commit comments

Comments
 (0)