From deba9413904ac61b90fed72474cd6f4529e488a5 Mon Sep 17 00:00:00 2001 From: Felix Weinberger Date: Mon, 13 Apr 2026 13:42:04 +0000 Subject: [PATCH] ci: only match open PRs in spec-sync existence check gh pr view matches closed PRs, so the job was editing closed PR #1152 instead of creating a new one. Use gh pr list --state open and edit by number. --- .github/workflows/update-spec-types.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-spec-types.yml b/.github/workflows/update-spec-types.yml index 5d6cec7b0..6f7bde8e4 100644 --- a/.github/workflows/update-spec-types.yml +++ b/.github/workflows/update-spec-types.yml @@ -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 ` 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" \