From 3cdeecc0fc46e66124dfed35934ba0bad4d451e6 Mon Sep 17 00:00:00 2001 From: Max P Date: Fri, 16 Aug 2024 17:34:54 +0200 Subject: [PATCH] Exit with error if conditions fail in release workflow Updated the release workflow to exit with status 1 instead of 0 when a version tag already exists or the version hasn't changed. This adjustment ensures the workflow stops for these error conditions, preventing unintended behavior or false success indications. Added `continue-on-error: true` to allow subsequent steps despite these non-critical errors. --- .github/workflows/CreateRelease.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CreateRelease.yml b/.github/workflows/CreateRelease.yml index 89acd11..65eb421 100644 --- a/.github/workflows/CreateRelease.yml +++ b/.github/workflows/CreateRelease.yml @@ -57,15 +57,16 @@ jobs: # Check if the version already exists as a tag if git rev-parse "refs/tags/${{ env.VERSION }}" >/dev/null 2>&1; then echo "Version ${{ env.VERSION }} already exists as a tag. No release will be created." - exit 0 + exit 1 fi # Compare current version with previous tag if [ "${{ env.VERSION }}" == "${{ env.PREVIOUS_TAG }}" ]; then echo "Version has not changed. No release will be created." - exit 0 + exit 1 fi shell: bash + continue-on-error: true - name: Generate release notes id: generate_notes