Skip to content

Commit

Permalink
fixup! Chore(ci): Publish only when git tag exists
Browse files Browse the repository at this point in the history
  • Loading branch information
literat committed Oct 10, 2024
1 parent 9bac127 commit fa9cd7e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ on:
- main

jobs:
hasTag:
has-tags:
name: 🏷️ Analyze Tags
runs-on: ubuntu-24.04

outputs:
hasTag: ${{ steps.checkTagExists.outputs.has-tag }}
has-tag: ${{ steps.check-tag-exists.outputs.has-tag }}

steps:
- name: Clone repository
Expand All @@ -22,7 +22,7 @@ jobs:
# ⚠️ This check works only if the tag is pushed alongside the commit
# Please, use `git push && git push --tags` or `git push --follow-tags` (works only for annonated tags)
- name: Check Tag On Commit
id: checkTagExists
id: check-tag-exists
run: |
if [ -n "$(git tag --points-at HEAD)" ]; then
echo "has-tag=true" >> $GITHUB_OUTPUT
Expand All @@ -32,8 +32,8 @@ jobs:
publish:
name: 📦 Publish Packages
needs: hasTag
if: ${{ needs.hasTag.outputs.hasTag == 'true' }}
needs: has-tags
if: ${{ needs.has-tags.outputs.has-tag == 'true' }}
runs-on: ubuntu-24.04

steps:
Expand Down

0 comments on commit fa9cd7e

Please sign in to comment.