ci: only match open PRs in spec-sync existence check (#1886)

This commit is contained in:
Felix Weinberger 2026-04-13 15:13:17 +01:00 • committed by GitHub
commit b65eb0939f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -70,9 +70,11 @@ jobs:
This is an automated update triggered by the nightly cron job."
if gh pr view update-spec-types &>/dev/null; then
echo "PR already exists, updating description..."
gh pr edit update-spec-types --body "$PR_BODY"
# `gh pr view <branch>` matches closed PRs too, so check for an *open* PR explicitly.
EXISTING_PR=$(gh pr list --head update-spec-types --state open --json number --jq '.[0].number // empty')
if [ -n "$EXISTING_PR" ]; then
echo "PR #$EXISTING_PR already exists, updating description..."
gh pr edit "$EXISTING_PR" --body "$PR_BODY"
else
gh pr create \
--title "chore: update spec.types.ts from upstream" \