Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Astraaaaaaa authored Aug 9, 2024
1 parent b3ed442 commit 35a815d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,13 @@ jobs:
- name: Check for Existing Tag
id: check_tag
run: |
TAG_NAME="${{ steps.determine_tag_name.outputs.tag_name }}"
existing_tag=$(curl -s -H "Authorization: token ${{ secrets.PAT }}" \
https://api.github.com/repos/${{ github.repository }}/git/refs/tags/$TAG_NAME | jq -r '.object.sha')
if ( "$existing_tag" != "null" ) {
echo "Tag $TAG_NAME already exists. Skipping release creation."
existing_tag=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/git/refs/tags/${{ env.tag_name }} | jq -r '.object.sha')
if [ "$existing_tag" != "null" ]; then
echo "tag_exists=true" >> $GITHUB_ENV
} else {
else
echo "tag_exists=false" >> $GITHUB_ENV
}
fi
- name: Create Release
id: create_release
Expand Down

0 comments on commit 35a815d

Please sign in to comment.