Skip to content

Commit 889e750

Browse files
authored
fix(ci): robust release publishing logic (#444)
1 parent 2fd4094 commit 889e750

1 file changed

Lines changed: 5 additions & 13 deletions

File tree

.github/workflows/_build-and-release.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -203,16 +203,8 @@ jobs:
203203
204204
echo "✓ Uploaded binaries to $TAG"
205205
206-
# Re-check draft status after upload (in case it changed)
207-
RELEASE_INFO_AFTER=$(gh api repos/${{ github.repository }}/releases/tags/$TAG 2>/dev/null || echo "")
208-
IS_DRAFT_AFTER=$(echo "$RELEASE_INFO_AFTER" | jq -r '.draft')
209-
echo "Release $TAG draft status after upload: $IS_DRAFT_AFTER"
210-
211-
# If release is still draft, publish it
212-
if [ "$IS_DRAFT_AFTER" = "true" ]; then
213-
echo "Publishing draft release..."
214-
gh release edit "$TAG" --draft=false
215-
echo "✓ Published release $TAG"
216-
else
217-
echo "Release is already published, skipping publish step"
218-
fi
206+
echo "Publishing release..."
207+
# Always attempt to undraft. This is safe and idempotent.
208+
# If it's already published, this does nothing but returns success.
209+
gh release edit "$TAG" --draft=false
210+
echo "✓ Published release $TAG"

0 commit comments

Comments
 (0)