Skip to content

Commit

Permalink
ci: do not version bump on no changes
Browse files Browse the repository at this point in the history
The script needs to exit if there are no changes produced by running `release-plz update`, otherwise
the `git commit` command will cause an error in the workflow.
  • Loading branch information
jacderida committed Jun 11, 2023
1 parent 067ddc7 commit b2398e6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/version_bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ jobs:
run: |
set -e
release-plz update
if [[ -z $(git status --porcelain) ]]; then
echo "No changes were detected. Exiting without bumping the version."
exit 0
fi
version=$(cat Cargo.toml | grep "^version" | awk -F '=' '{ print $2 }' | xargs)
commit_message="chore: release $version"
git add --all
Expand Down

0 comments on commit b2398e6

Please sign in to comment.