Skip to content

Commit

Permalink
ci: using git fetch --tags instead of GitHub API calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Suisuroru committed Jan 23, 2025
1 parent 2101f78 commit bb2d41a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/auto_build_jar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@ jobs:
- name: Check if tag exists
id: check_tag
run: |
OWNER=$(echo "${{ github.repository }}" | cut -d'/' -f1)
REPO=$(echo "${{ github.repository }}" | cut -d'/' -f2)
TAG_EXISTS=$(gh api -H "api.github.com" /repos/$OWNER/$REPO/git/refs/tags/${{ env.VERSION }} --jq '.ref' | wc -l)
if [ "$TAG_EXISTS" -eq 1 ]; then
git fetch --tags
if git show-ref --tags --quiet refs/tags/${{ env.VERSION }}; then
echo "Tag exists"
echo "SKIP_BUILD=true" >> $GITHUB_ENV
else
Expand Down

0 comments on commit bb2d41a

Please sign in to comment.