Skip to content

Commit

Permalink
Chore(ci): Publish only when git tag exists
Browse files Browse the repository at this point in the history
refs #DS-1434
  • Loading branch information
literat committed Oct 4, 2024
1 parent 4fc53a1 commit 123c7d4
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,34 @@ on:
- release/beta

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

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

steps:
- name: Clone repository
uses: actions/checkout@v4
with:
fetch-tags: true

- name: Check Tag On Commit
id: checkTagExists
run: |
if [ -n "$(git tag --points-at HEAD)" ]; then
echo "has-tag=true" >> $GITHUB_OUTPUT
else
echo "has-tag=false" >> $GITHUB_OUTPUT
fi
publish:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
name: Publish package
name: 🚀 📦 Publish Package
needs: hasTag
if: ${{ needs.hasTag.outputs.hasTag == 'true' }}
runs-on: ubuntu-24.04

steps:
- name: Clone repository
uses: actions/checkout@v4
Expand Down

0 comments on commit 123c7d4

Please sign in to comment.