From 93a4cbbc9008e547d0aa6717d5a924eeaed61baf Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Mon, 7 Sep 2026 14:44:07 -0700 Subject: [PATCH 1/3] fix: use fixed branch name for sync-output PRs to prevent duplicates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously the branch was named docs/sync-output-YYYY-MM-DD, so each daily run created a new branch and opened a new PR — even though an existing one was still open. There are currently 5 stale open PRs as a result. Use a fixed branch name (docs/sync-output) instead. The force-push already updates the branch in-place; the gh pr view guard then skips opening a new PR when one is already open, so re-runs simply update the existing PR. --- .github/workflows/sync_docs.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sync_docs.yml b/.github/workflows/sync_docs.yml index 59eb0e5c..4e5499e7 100644 --- a/.github/workflows/sync_docs.yml +++ b/.github/workflows/sync_docs.yml @@ -72,7 +72,7 @@ jobs: **Review the diff before merging** to confirm the changes look correct and there are no unexpected formatting regressions. run: | - BRANCH="docs/sync-output-$(date +%Y-%m-%d)" + BRANCH="docs/sync-output" git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git checkout -b "$BRANCH" @@ -81,6 +81,7 @@ jobs: git push --force origin "$BRANCH" # Open a PR only if one doesn't already exist for this branch. + # If it does exist, the force-push above has already updated it. if ! gh pr view "$BRANCH" --json number -q .number 2>/dev/null; then gh pr create \ --title "docs: sync dbc command output" \ From 00aa8c81bf2cb4d8da2172115540ff9c14a6f185 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Mon, 7 Sep 2026 14:49:21 -0700 Subject: [PATCH 2/3] Skip closed prs --- .github/workflows/sync_docs.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sync_docs.yml b/.github/workflows/sync_docs.yml index 4e5499e7..ee6f41a8 100644 --- a/.github/workflows/sync_docs.yml +++ b/.github/workflows/sync_docs.yml @@ -80,9 +80,10 @@ jobs: git commit -m "docs: sync dbc command output" git push --force origin "$BRANCH" - # Open a PR only if one doesn't already exist for this branch. - # If it does exist, the force-push above has already updated it. - if ! gh pr view "$BRANCH" --json number -q .number 2>/dev/null; then + # Open a PR only if there isn't already an open one for this branch. + # If there is, the force-push above has already updated it. + OPEN_PR_COUNT="$(gh pr list --head "$BRANCH" --base main --state open --limit 1 --json number --jq 'length')" + if [ "$OPEN_PR_COUNT" -eq 0 ]; then gh pr create \ --title "docs: sync dbc command output" \ --body "$PR_BODY" \ From 27e1ba37f9ccf8ed6e76243ba37628762d657226 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Mon, 7 Sep 2026 14:57:32 -0700 Subject: [PATCH 3/3] fix: skip push when remote branch already has identical docs content MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avoids noisy daily force-pushes (and associated CI reruns) when the open PR already reflects the current dbc output. The step only fires when docs/ on main is stale vs dbc, so we know changes exist relative to main — but if the remote docs/sync-output branch was already pushed with the same content (i.e. dbc hasn't released since), there's nothing new to push. Uses git diff --cached against origin/docs/sync-output -- docs/ to compare just the docs subtree. --- .github/workflows/sync_docs.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sync_docs.yml b/.github/workflows/sync_docs.yml index ee6f41a8..0881f3c7 100644 --- a/.github/workflows/sync_docs.yml +++ b/.github/workflows/sync_docs.yml @@ -75,8 +75,22 @@ jobs: BRANCH="docs/sync-output" git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - git checkout -b "$BRANCH" + + # Fetch the remote branch so we can compare docs/ against it. + git fetch origin "$BRANCH" 2>/dev/null || true + + # Stage the changes so we can compare against the remote branch. git add docs/ + + # If the remote branch already has identical docs/ content, the + # open PR is already up to date — skip the push to avoid noise. + if git rev-parse "origin/$BRANCH" >/dev/null 2>&1 && \ + git diff --cached --quiet "origin/$BRANCH" -- docs/; then + echo "Remote branch already up to date, nothing to push." + exit 0 + fi + + git checkout -b "$BRANCH" git commit -m "docs: sync dbc command output" git push --force origin "$BRANCH"