File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -70,10 +70,28 @@ jobs:
7070 echo | /tmp/bin/minisign -s /tmp/minisign.key -Sm *.tar.gz *.zip
7171 ls -l dnscrypt-proxy*
7272
73+ - name : Check if release exists
74+ id : check_release
75+ if : startsWith(github.ref, 'refs/tags/')
76+ run : |
77+ TAG="${GITHUB_REF#refs/tags/}"
78+ HTTP_CODE=$(curl -s -o response.json -w "%{http_code}" \
79+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
80+ https://api.github.com/repos/${{ github.repository }}/releases/tags/$TAG)
81+ if [ "$HTTP_CODE" = "200" ]; then
82+ echo "release_exists=true" >> $GITHUB_ENV
83+ else
84+ echo "release_exists=false" >> $GITHUB_ENV
85+ fi
86+
87+ - name : Debug Release Existence
88+ if : startsWith(github.ref, 'refs/tags/')
89+ run : echo "Release exists? ${{ env.release_exists }}"
90+
7391 - name : Create release
7492 id : create_release
7593 uses : actions/create-release@v1
76- if : startsWith(github.ref, 'refs/tags/')
94+ if : startsWith(github.ref, 'refs/tags/') && env.release_exists == 'false'
7795 env :
7896 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
7997 with :
You can’t perform that action at this time.
0 commit comments