Skip to content

Commit

Permalink
Check if commit would fail due to lack of changes
Browse files Browse the repository at this point in the history
Sometimes we might run this when the version number is already
correct; e.g. when cleaning up from a failed release attempt.

In that case, skip the commit and apply the tag to the existing last
commit.
  • Loading branch information
ajjackson committed Dec 11, 2024
1 parent 1eaca1f commit 3a38209
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/set_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@ jobs:
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add euphonic/version.py CITATION.cff
git commit -m "Set version number"
if git diff --cached --quiet
then
echo "No files were changed, skipping commit"
else
git commit -m "Set version number"
fi
- name: "Tag new commit"
shell: bash -l {0}
Expand Down

0 comments on commit 3a38209

Please sign in to comment.