diff --git a/.gitea/workflows/checkForTag.yaml b/.gitea/workflows/checkForTag.yaml index f94da7d..9ed23fc 100644 --- a/.gitea/workflows/checkForTag.yaml +++ b/.gitea/workflows/checkForTag.yaml @@ -20,17 +20,18 @@ jobs: tag=$(curl -s -H "Authorization: token $API_TOKEN" "$GITEA_API_URL/repos/$OWNER/${{ inputs.repo }}/tags/${{ inputs.tag }}") + echo "Tag details: $tag" + if [ "$tag" = "404 page not found" ]; then echo "Tag not found" exit 0 fi - echo "Tag details: $tag" - if echo "$tag" | jq -e '.error' > /dev/null; then - echo "This Tag not exists" - exit 0 - else - echo "This Tag allready exists" + if echo "$tag" | jq -e '.name' != 'null'; then + echo "This Tag already exists" exit 1 - fi \ No newline at end of file + fi + + echo "This Tag not exists" + exit 0 \ No newline at end of file