diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index acc0c99..9fb95b1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,33 +37,41 @@ jobs: id: check_release run: | HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + -H "Accept: application/vnd.github.v3+json" \ https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ steps.extract_data.outputs.version }}) if [ "$HTTP_STATUS" = "200" ]; then echo "exists=true" >> $GITHUB_OUTPUT else echo "exists=false" >> $GITHUB_OUTPUT fi + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Delete existing release and tag if found if: steps.check_release.outputs.exists == 'true' run: | RELEASE_ID=$(curl -s \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + -H "Accept: application/vnd.github.v3+json" \ https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ steps.extract_data.outputs.version }} \ | jq -r .id) # Delete the existing release curl -s \ -X DELETE \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + -H "Accept: application/vnd.github.v3+json" \ https://api.github.com/repos/${{ github.repository }}/releases/$RELEASE_ID # Delete the existing tag reference curl -s \ -X DELETE \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + -H "Accept: application/vnd.github.v3+json" \ https://api.github.com/repos/${{ github.repository }}/git/refs/tags/${{ steps.extract_data.outputs.version }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Create GitHub Release id: create_release @@ -83,4 +91,4 @@ jobs: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: obsidian-vault-${{ steps.extract_data.outputs.version }}.zip asset_name: obsidian-vault-${{ steps.extract_data.outputs.version }}.zip - asset_content_type: application/zip + asset_content_type: application/zip \ No newline at end of file