-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb4c99b
commit 5c36e8c
Showing
1 changed file
with
4 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|