ci: only match open PRs in spec-sync existence check (#1886)
This commit is contained in:
parent
d4f802ef39
commit
b65eb0939f
1 changed files with 5 additions and 3 deletions
8
.github/workflows/update-spec-types.yml
vendored
8
.github/workflows/update-spec-types.yml
vendored
|
|
@ -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" \
|
||||
|
|
|
|||
Loading…
Reference in a new issue