Add Check for Empty Release and Exit Early
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Sarah Jamie Lewis 2024-02-23 20:36:14 -08:00
parent f235e56fbb
commit 098adc46e6
Signed by: sarah
GPG Key ID: F27FD21A270837EF
1 changed files with 5 additions and 0 deletions

View File

@ -4,6 +4,11 @@ VERSION=$(cat VERSION)
echo "Grabbing Release Data From:" "https://git.openprivacy.ca/api/v1/repos/$DRONE_REPO/releases/tags/$VERSION"
RELEASEID=$(curl -s -X 'GET' "https://git.openprivacy.ca/api/v1/repos/$DRONE_REPO/releases/tags/$VERSION" -H 'accept: application/json' | jq '.id')
echo $RELEASEID
if [ "$RELEASEID" = "null" ]; then
# $var is empty
exit 1
fi
URL="$PLUGIN_GOGS_URL/api/v1/repos/$DRONE_REPO/releases/$RELEASEID/assets?name=$1"
FILE="@$1"