Skip to content

Commit 1b649bc

Browse files
committed
[skip ci] ci: handle release not existing
1 parent 450ee2a commit 1b649bc

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

.github/workflows/release-abort-release.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,9 @@ jobs:
111111
REPO: ${{ github.event.inputs.repository_name }}
112112
run: |
113113
set -euo pipefail
114-
115-
release_json="$(gh api -H 'Accept: application/vnd.github+json' "/repos/$OWNER/$REPO/releases/tags/$TAG" || true)"
116-
if [ -n "$release_json" ]; then
117-
# only pre-releases can be removed
114+
115+
if release_json="$(gh api -H 'Accept: application/vnd.github+json' \
116+
"/repos/$OWNER/$REPO/releases/tags/$TAG" 2>/dev/null)"; then
118117
if [ "$(jq -r '.prerelease' <<<"$release_json")" != "true" ]; then
119118
echo "❌ Release $TAG exists but is *not* marked as a pre-release. Aborting."
120119
exit 1

0 commit comments

Comments
 (0)