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.
This commit is contained in:
2024-08-16 17:34:54 +02:00
parent 4f4145faa0
commit 3cdeecc0fc

View File

@@ -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