Skip to content

Commit

Permalink
Merge pull request #9 from creative-commoners/pulls/1.0/dont-exit-if-…
Browse files Browse the repository at this point in the history
…missing-release

FIX Don't exit if a release doesn't exist.
  • Loading branch information
emteknetnz authored Jun 19, 2022
2 parents 7c6c4d1 + a71b95c commit 4b63136
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,14 @@ runs:
-X GET https://api.github.com/repos/$GITHUB_REPOSITORY/releases/tags/$TAG \
-H "Accept: application/vnd.github.v3+json")
if [[ $RESP_CODE != "200" ]]; then
echo "Unable to check tag status for $TAG - HTTP response code was $RESP_CODE"
exit 1
RESP_MSG=$(jq -r .message __response.json)
if [[ $RESP_MSG != "Not Found" ]]; then
echo "Unable to check tag status for $TAG - HTTP response code was $RESP_CODE and message was $RESP_MSG"
exit 1
fi
fi
RELEASE_ID=$(jq .id __response.json)
if [[ $RELEASE_ID == "null" ]]; then
if [[ $RESP_CODE == "404" || $RELEASE_ID == "null" ]]; then
echo "Did not find an existing release for tag $TAG"
else
# https://docs.github.com/en/rest/releases/releases#delete-a-release
Expand Down

0 comments on commit 4b63136

Please sign in to comment.