diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0662ca1..6894475 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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