Skip to content

Commit

Permalink
Fix status
Browse files Browse the repository at this point in the history
  • Loading branch information
Andriiklymiuk committed May 30, 2023
1 parent eb4c99b commit 5c36e8c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ jobs:
echo "TAG: $TAG"
# Check if the tag exists
EXISTS=$(curl -s https://api.github.com/repos/${GITHUB_REPOSITORY}/git/ref/tags/$TAG)
HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer ${GITHUB_TOKEN}" https://api.github.com/repos/${GITHUB_REPOSITORY}/git/ref/tags/$TAG)
if [ "$EXISTS" == "null" ]
if [ "$HTTP_STATUS" -ne 200 ]
then
echo "Tag does not exist, creating new tag"
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
git tag $TAG
git push origin $TAG
echo "TAG_EXISTS=false" >> $GITHUB_ENV
Expand Down

0 comments on commit 5c36e8c

Please sign in to comment.