Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
0xBeycan committed Jan 4, 2024
1 parent 636f067 commit 2399a99
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/create-auto-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ jobs:

- name: Check if release already exists
run: |
TAG_NAME=${{ github.ref_name }}
RELEASE_EXISTS=$(git ls-remote --exit-code --tags origin "$TAG_NAME^{}" | wc -l)
echo "RELEASE_EXISTS=$RELEASE_EXISTS" >> $GITHUB_ENV
existing_release=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ github.ref_name }} 2>&1)
if [[ $existing_release == *"Not Found"* ]]; then
echo "RELEASE_EXISTS=false" >> $GITHUB_ENV
else
echo "RELEASE_EXISTS=true" >> $GITHUB_ENV
fi
- name: Create Release
id: create_release
Expand Down

0 comments on commit 2399a99

Please sign in to comment.