From b2398e679b00cc8b8097e9838042cab17262f771 Mon Sep 17 00:00:00 2001 From: Chris O'Neil Date: Sun, 11 Jun 2023 21:39:17 +0100 Subject: [PATCH] ci: do not version bump on no changes 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. --- .github/workflows/version_bump.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/version_bump.yml b/.github/workflows/version_bump.yml index 6c24013..7c340f0 100644 --- a/.github/workflows/version_bump.yml +++ b/.github/workflows/version_bump.yml @@ -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