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:
5
.github/workflows/CreateRelease.yml
vendored
5
.github/workflows/CreateRelease.yml
vendored
@@ -57,15 +57,16 @@ jobs:
|
|||||||
# Check if the version already exists as a tag
|
# Check if the version already exists as a tag
|
||||||
if git rev-parse "refs/tags/${{ env.VERSION }}" >/dev/null 2>&1; then
|
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."
|
echo "Version ${{ env.VERSION }} already exists as a tag. No release will be created."
|
||||||
exit 0
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Compare current version with previous tag
|
# Compare current version with previous tag
|
||||||
if [ "${{ env.VERSION }}" == "${{ env.PREVIOUS_TAG }}" ]; then
|
if [ "${{ env.VERSION }}" == "${{ env.PREVIOUS_TAG }}" ]; then
|
||||||
echo "Version has not changed. No release will be created."
|
echo "Version has not changed. No release will be created."
|
||||||
exit 0
|
exit 1
|
||||||
fi
|
fi
|
||||||
shell: bash
|
shell: bash
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Generate release notes
|
- name: Generate release notes
|
||||||
id: generate_notes
|
id: generate_notes
|
||||||
|
Reference in New Issue
Block a user