Skip to content

Commit

Permalink
ci: fix release workflow when no version is produced
Browse files Browse the repository at this point in the history
Skip deploy step when there is no version produced by semantic release.
  • Loading branch information
jboix committed Oct 15, 2024
1 parent 7ce4e5a commit 21f1d32
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,23 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npx semantic-release
VERSION=$(cat VERSION)
echo "Resolved version: $VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Check version
id: check_version
run: >
if [ -f VERSION ]; then
VERSION=$(cat VERSION)
echo "Resolved version: $VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT
else
echo "No version produced."
echo "version=" >> $GITHUB_OUTPUT
fi
deploy:
runs-on: ubuntu-latest
needs: release
if: needs.release.outputs.version != '' # Skip deploy if no version is set
permissions:
id-token: write
env:
Expand Down

0 comments on commit 21f1d32

Please sign in to comment.