Skip to content

Commit

Permalink
FIX Don't exit if a release doesn't exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Jun 19, 2022
1 parent 7c6c4d1 commit a71b95c
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 a71b95c

Please sign in to comment.