Skip to content

Commit

Permalink
fix: tagger workflows not working (#122)
Browse files Browse the repository at this point in the history
* fix: tagger workflows not working

* apply full match
  • Loading branch information
MaikoTan committed Nov 16, 2023
1 parent bbf7997 commit f160e18
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions .github/workflows/tagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,22 @@ jobs:

- name: Check current version
id: check_version
run: echo "VERSION=$(node -p "require('./packages/core/package.json').version")" >> $GITHUB_OUTPUT

- name: Check remote tags
id: check_tags
run: |
git fetch --tags
echo "TAGS=$(git tag -l)" >> $GITHUB_OUTPUT
run: echo "TAG=v$(node -p "require('./packages/core/package.json').version")" >> $GITHUB_OUTPUT

- name: Check if tag exists
id: check_tag
run: |
if [[ "${{ steps.check_tags.outputs.TAGS }}" == *"${{ steps.check_version.outputs.VERSION }}"* ]]; then
echo "TAG_EXISTS=true" >> $GITHUB_OUTPUT
else
git fetch --tags
if [ -z "$(git tag -l | grep -w "^${{ steps.check_version.outputs.TAG }}\$")" ]; then
echo "TAG_EXISTS=false" >> $GITHUB_OUTPUT
else
echo "TAG_EXISTS=true" >> $GITHUB_OUTPUT
fi
- name: Push tag
if: ${{ github.ref == 'refs/heads/master' && steps.check_tag.outputs.TAG_EXISTS == 'false' }}
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git tag ${{ steps.check_version.outputs.VERSION }}
git push origin ${{ steps.check_version.outputs.VERSION }}
git tag ${{ steps.check_version.outputs.TAG }}
git push origin ${{ steps.check_version.outputs.TAG }}

0 comments on commit f160e18

Please sign in to comment.