From f25361a658ddb91032157f25b3a5d79b68960c58 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Fri, 28 Aug 2026 11:39:49 +0200 Subject: [PATCH] fix: Daily sync should be aware of PR open/closed state --- .github/workflows/schema-sync.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/schema-sync.yml b/.github/workflows/schema-sync.yml index 449acc7..f3b6816 100644 --- a/.github/workflows/schema-sync.yml +++ b/.github/workflows/schema-sync.yml @@ -54,8 +54,17 @@ jobs: git commit -m "chore(schema): sync from upstream" git push --force origin automation/schema-sync - if gh pr view automation/schema-sync --json number >/dev/null 2>&1; then - echo "PR already open for automation/schema-sync -> branch updated." + pr_number=$( + gh pr list \ + --head automation/schema-sync \ + --base main \ + --state open \ + --json number \ + --jq '.[0].number' + ) + + if [ -n "$pr_number" ]; then + echo "Updated existing schema-sync PR #${pr_number}." else gh pr create \ --title "chore(schema): sync from upstream" \