From 3cb2cd22952ee13954881555bccaa36e0053b400 Mon Sep 17 00:00:00 2001 From: Claude Code Date: Mon, 20 Apr 2026 20:31:14 -0700 Subject: [PATCH 1/6] feat: add auto-rebase workflow for non-Dependabot PRs Extends the dependabot-rebase pattern to cover all non-Dependabot PRs. On every push to main, finds open same-repo PRs that are behind the base branch and updates them via the GitHub update-branch API. Handles two failure modes gracefully: - workflow-permission 403: posts an idempotent comment asking the author to rebase manually (sentinel: ) - merge conflict 422: posts an idempotent comment asking the author to resolve conflicts (sentinel: ) Skips Dependabot PRs (handled by dependabot-rebase.yml) and fork PRs. --- .github/workflows/auto-rebase-reusable.yml | 130 +++++++++++++++++++++ .github/workflows/auto-rebase.yml | 44 +++++++ standards/workflows/auto-rebase.yml | 42 +++++++ 3 files changed, 216 insertions(+) create mode 100644 .github/workflows/auto-rebase-reusable.yml create mode 100644 .github/workflows/auto-rebase.yml create mode 100644 standards/workflows/auto-rebase.yml diff --git a/.github/workflows/auto-rebase-reusable.yml b/.github/workflows/auto-rebase-reusable.yml new file mode 100644 index 000000000..f563e92b4 --- /dev/null +++ b/.github/workflows/auto-rebase-reusable.yml @@ -0,0 +1,130 @@ +# Reusable auto-rebase workflow — single source of truth for the org. +# Repo-level auto-rebase.yml files call this to avoid duplicating +# the branch-update logic. +# Standard: https://github.com/petry-projects/.github/blob/main/standards/ci-standards.md +# +# Problem: when branch protection requires branches to be up-to-date +# (strict status checks), merging any PR makes other open PRs fall behind. +# Non-Dependabot PRs have no equivalent of Dependabot's scheduled rebase, +# so they silently fall behind until a human notices. +# +# Solution: after every push to main (typically a merged PR), this workflow: +# 1. Finds all open non-Dependabot PRs from the same repo (no fork PRs) +# 2. Updates behind PRs using the merge method (not rebase) +# +# Skips Dependabot PRs — those are handled by dependabot-rebase-reusable.yml. +# Skips fork PRs — update-branch requires push access to the head branch. +# +# Important: never use the API update-branch endpoint with rebase method — +# it rewrites SHAs, which can confuse CI and invalidate existing approvals. +# The merge method preserves the original commits. +# +# Failure modes handled gracefully: +# - without `workflows` permission (403): posts an idempotent comment asking +# the author to rebase manually (sentinel: ) +# - merge conflict (422): posts an idempotent comment asking the author to +# resolve conflicts (sentinel: ) +# +# No secrets required — uses github.token only. No auto-merge logic. +name: Auto-rebase non-Dependabot PRs (Reusable) + +on: + workflow_call: + +jobs: + auto-rebase: + runs-on: ubuntu-latest + permissions: + contents: write # needed for update-branch (may touch .github/workflows/) + pull-requests: write # needed to post comments on PRs + steps: + - name: Update behind non-Dependabot PRs + env: + GH_TOKEN: ${{ github.token }} + REPO: ${{ github.repository }} + run: | + # Find open non-Dependabot PRs from the same repo (exclude forks) + PRS=$(gh api "repos/$REPO/pulls?state=open&per_page=100" \ + --jq '.[] | select(.user.login != "dependabot[bot]") | select(.head.repo.full_name == .base.repo.full_name) | "\(.number) \(.head.ref)"') + + if [[ -z "$PRS" ]]; then + echo "No open non-Dependabot same-repo PRs" + exit 0 + fi + + while IFS=' ' read -r PR_NUMBER HEAD_REF; do + # Get the base branch for this PR + BASE_BRANCH=$(gh api "repos/$REPO/pulls/$PR_NUMBER" --jq '.base.ref') + + BEHIND=$(gh api "repos/$REPO/compare/${BASE_BRANCH}...${HEAD_REF}" \ + --jq '.behind_by') + + if [[ "$BEHIND" -eq 0 ]]; then + echo "PR #$PR_NUMBER ($HEAD_REF) is up to date — skipping" + continue + fi + + echo "PR #$PR_NUMBER ($HEAD_REF) is $BEHIND commit(s) behind $BASE_BRANCH — updating branch" + + # Capture both stdout and stderr; use if-then to avoid bash -e terminating + # the step on non-zero exit before we can inspect the error message. + if UPDATE_OUTPUT=$(gh api "repos/$REPO/pulls/$PR_NUMBER/update-branch" \ + -X PUT -f update_method=merge 2>&1); then + if [[ -n "$UPDATE_OUTPUT" ]]; then echo "$UPDATE_OUTPUT"; fi + echo " Branch updated" + else + HTTP_STATUS=$(echo "$UPDATE_OUTPUT" | grep -oP 'HTTP \K[0-9]+' | head -1) + echo " Update failed (HTTP $HTTP_STATUS): $UPDATE_OUTPUT" + + if echo "$UPDATE_OUTPUT" | grep -qF "without \`workflows\` permission"; then + # GitHub blocks update-branch when merging the base would add + # .github/workflows/ changes and the token lacks the 'workflows' + # permission. Ask the author to rebase manually. + # + # Idempotent: skip if sentinel comment already exists. + SENTINEL="" + ALREADY_POSTED=$(gh api "repos/$REPO/issues/$PR_NUMBER/comments" \ + --jq "[.[] | select(.body | contains(\"$SENTINEL\"))] | length") + if [[ "$ALREADY_POSTED" -gt 0 ]]; then + echo " Skipping — blocked comment already posted" + else + echo " Posting manual-rebase request (workflows permission missing)" + gh pr comment "$PR_NUMBER" --repo "$REPO" --body " +**Auto-rebase blocked** — the base branch contains \`.github/workflows/\` changes that require the \`workflows\` permission to merge into this branch, but the auto-rebase workflow's token does not have that permission. + +Please rebase this branch manually: +\`\`\` +git fetch origin +git rebase origin/$BASE_BRANCH +git push --force-with-lease +\`\`\`" + fi + elif echo "$UPDATE_OUTPUT" | grep -qE "HTTP 422|merge conflict"; then + # Merge conflict — ask the author to resolve it. + # + # Idempotent: skip if sentinel comment already exists. + SENTINEL="" + ALREADY_POSTED=$(gh api "repos/$REPO/issues/$PR_NUMBER/comments" \ + --jq "[.[] | select(.body | contains(\"$SENTINEL\"))] | length") + if [[ "$ALREADY_POSTED" -gt 0 ]]; then + echo " Skipping — conflict comment already posted" + else + echo " Posting conflict resolution request" + gh pr comment "$PR_NUMBER" --repo "$REPO" --body " +**Auto-rebase failed — merge conflict** — this branch has conflicts with \`$BASE_BRANCH\` that must be resolved manually. + +Please resolve the conflicts and push: +\`\`\` +git fetch origin +git merge origin/$BASE_BRANCH +# resolve conflicts, then: +git add . +git commit +git push +\`\`\`" + fi + else + echo " Warning: failed to update PR #$PR_NUMBER — $UPDATE_OUTPUT" + fi + fi + done <<< "$PRS" diff --git a/.github/workflows/auto-rebase.yml b/.github/workflows/auto-rebase.yml new file mode 100644 index 000000000..0c084b0bb --- /dev/null +++ b/.github/workflows/auto-rebase.yml @@ -0,0 +1,44 @@ +# ───────────────────────────────────────────────────────────────────────────── +# SOURCE OF TRUTH: petry-projects/.github/standards/workflows/auto-rebase.yml +# Standard: petry-projects/.github/standards/ci-standards.md +# Reusable: petry-projects/.github/.github/workflows/auto-rebase-reusable.yml +# +# AGENTS — READ BEFORE EDITING: +# • This file is a THIN CALLER STUB. All branch-update logic lives in the +# reusable workflow above. +# • You MAY change: nothing in normal use. NOTE: this file intentionally uses +# a LOCAL ref (`./`) instead of a pinned SHA — this repo IS the source of +# truth, so a local ref is always current. Other repos use pinned SHAs +# (see standards/workflows/auto-rebase.yml). +# • You MUST NOT change: trigger event, the concurrency group name, +# or the job-level `permissions:` block — reusable workflows can be +# granted no more permissions than the calling job has, so removing +# the stanza breaks the reusable's gh API calls. +# • If you need different behaviour, open a PR against the reusable in the +# central repo. +# ───────────────────────────────────────────────────────────────────────────── +# +# Auto-rebase non-Dependabot PRs — thin caller for the org-level reusable. +# To adopt: copy standards/workflows/auto-rebase.yml to your repo. +# No secrets required — uses GITHUB_TOKEN only. +name: Auto-rebase non-Dependabot PRs + +on: + push: + branches: + - main + workflow_dispatch: + +concurrency: + group: auto-rebase + cancel-in-progress: false + +permissions: {} + +jobs: + auto-rebase: + permissions: + contents: write # update-branch via GITHUB_TOKEN (may touch .github/workflows/) + pull-requests: write # post comments on PRs + uses: ./.github/workflows/auto-rebase-reusable.yml # local ref — always current + secrets: inherit diff --git a/standards/workflows/auto-rebase.yml b/standards/workflows/auto-rebase.yml new file mode 100644 index 000000000..0e60e37cc --- /dev/null +++ b/standards/workflows/auto-rebase.yml @@ -0,0 +1,42 @@ +# ───────────────────────────────────────────────────────────────────────────── +# SOURCE OF TRUTH: petry-projects/.github/standards/workflows/auto-rebase.yml +# Standard: petry-projects/.github/standards/ci-standards.md +# Reusable: petry-projects/.github/.github/workflows/auto-rebase-reusable.yml +# +# AGENTS — READ BEFORE EDITING: +# • This file is a THIN CALLER STUB. All branch-update logic lives in the +# reusable workflow above. +# • You MAY change: the SHA in the `uses:` line when upgrading the reusable +# workflow version (bump SHA to latest main of petry-projects/.github). +# • You MUST NOT change: trigger event, the concurrency group name, +# or the job-level `permissions:` block — reusable workflows can be +# granted no more permissions than the calling job has, so removing +# the stanza breaks the reusable's gh API calls. +# • If you need different behaviour, open a PR against the reusable in the +# central repo. +# ───────────────────────────────────────────────────────────────────────────── +# +# Auto-rebase non-Dependabot PRs — thin caller for the org-level reusable. +# To adopt: copy this file to .github/workflows/auto-rebase.yml in your repo. +# No secrets required — uses GITHUB_TOKEN only. +name: Auto-rebase non-Dependabot PRs + +on: + push: + branches: + - main + workflow_dispatch: + +concurrency: + group: auto-rebase + cancel-in-progress: false + +permissions: {} + +jobs: + auto-rebase: + permissions: + contents: write # update-branch via GITHUB_TOKEN (may touch .github/workflows/) + pull-requests: write # post comments on PRs + uses: petry-projects/.github/.github/workflows/auto-rebase-reusable.yml@v1 + secrets: inherit From bc7c488e1547b869b4bdd5883795315a3926f11e Mon Sep 17 00:00:00 2001 From: Claude Code Date: Mon, 20 Apr 2026 20:36:33 -0700 Subject: [PATCH 2/6] fix(auto-rebase): correct error handling in reusable workflow - Add explicit .head.repo != null guard in jq filter (deleted forks return null for .head.repo; explicit check is clearer than relying on null comparison being false) - Drop HTTP status extraction via grep: gh api does not output 'HTTP NNN' in that format; the variable was unused in fix logic - Fix merge conflict detection: was 'HTTP 422|merge conflict' but 'HTTP 422' never appears in gh api error output; use grep -qi 'merge conflict' to match GitHub's JSON error message - Use gh pr view --json comments for sentinel checks, matching the dependabot-rebase-reusable.yml pattern --- .github/workflows/auto-rebase-reusable.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/auto-rebase-reusable.yml b/.github/workflows/auto-rebase-reusable.yml index f563e92b4..f6aa47751 100644 --- a/.github/workflows/auto-rebase-reusable.yml +++ b/.github/workflows/auto-rebase-reusable.yml @@ -45,7 +45,7 @@ jobs: run: | # Find open non-Dependabot PRs from the same repo (exclude forks) PRS=$(gh api "repos/$REPO/pulls?state=open&per_page=100" \ - --jq '.[] | select(.user.login != "dependabot[bot]") | select(.head.repo.full_name == .base.repo.full_name) | "\(.number) \(.head.ref)"') + --jq '.[] | select(.user.login != "dependabot[bot]") | select(.head.repo != null) | select(.head.repo.full_name == .base.repo.full_name) | "\(.number) \(.head.ref)"') if [[ -z "$PRS" ]]; then echo "No open non-Dependabot same-repo PRs" @@ -73,8 +73,7 @@ jobs: if [[ -n "$UPDATE_OUTPUT" ]]; then echo "$UPDATE_OUTPUT"; fi echo " Branch updated" else - HTTP_STATUS=$(echo "$UPDATE_OUTPUT" | grep -oP 'HTTP \K[0-9]+' | head -1) - echo " Update failed (HTTP $HTTP_STATUS): $UPDATE_OUTPUT" + echo " Update failed: $UPDATE_OUTPUT" if echo "$UPDATE_OUTPUT" | grep -qF "without \`workflows\` permission"; then # GitHub blocks update-branch when merging the base would add @@ -83,8 +82,8 @@ jobs: # # Idempotent: skip if sentinel comment already exists. SENTINEL="" - ALREADY_POSTED=$(gh api "repos/$REPO/issues/$PR_NUMBER/comments" \ - --jq "[.[] | select(.body | contains(\"$SENTINEL\"))] | length") + ALREADY_POSTED=$(gh pr view "$PR_NUMBER" --repo "$REPO" \ + --json comments --jq "[.comments[] | select(.body | contains(\"$SENTINEL\"))] | length") if [[ "$ALREADY_POSTED" -gt 0 ]]; then echo " Skipping — blocked comment already posted" else @@ -99,13 +98,14 @@ git rebase origin/$BASE_BRANCH git push --force-with-lease \`\`\`" fi - elif echo "$UPDATE_OUTPUT" | grep -qE "HTTP 422|merge conflict"; then + elif echo "$UPDATE_OUTPUT" | grep -qi "merge conflict"; then # Merge conflict — ask the author to resolve it. + # gh api surfaces the GitHub API error JSON: {"message":"merge conflict",...} # # Idempotent: skip if sentinel comment already exists. SENTINEL="" - ALREADY_POSTED=$(gh api "repos/$REPO/issues/$PR_NUMBER/comments" \ - --jq "[.[] | select(.body | contains(\"$SENTINEL\"))] | length") + ALREADY_POSTED=$(gh pr view "$PR_NUMBER" --repo "$REPO" \ + --json comments --jq "[.comments[] | select(.body | contains(\"$SENTINEL\"))] | length") if [[ "$ALREADY_POSTED" -gt 0 ]]; then echo " Skipping — conflict comment already posted" else From a8ea154418989c29f6bd3b9195ea1b6a35b05361 Mon Sep 17 00:00:00 2001 From: Claude Code Date: Mon, 20 Apr 2026 20:43:54 -0700 Subject: [PATCH 3/6] docs: add auto-rebase to standards and compliance audit - Add auto-rebase.yml to Available Templates table in ci-standards.md - Add section 8 documenting auto-rebase behaviour, failure modes, and compliance expectations; renumber Feature Ideation to section 9 - Add auto-rebase.yml:auto-rebase-reusable to check_centralized_workflow_stubs so repos adopting the workflow are verified as thin caller stubs --- scripts/compliance-audit.sh | 1 + standards/ci-standards.md | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/scripts/compliance-audit.sh b/scripts/compliance-audit.sh index d05fc724d..a88912f5a 100755 --- a/scripts/compliance-audit.sh +++ b/scripts/compliance-audit.sh @@ -604,6 +604,7 @@ check_centralized_workflow_stubs() { # workflow-filename:expected-reusable-basename local centralized=( "claude.yml:claude-code-reusable" + "auto-rebase.yml:auto-rebase-reusable" "dependency-audit.yml:dependency-audit-reusable" "dependabot-automerge.yml:dependabot-automerge-reusable" "dependabot-rebase.yml:dependabot-rebase-reusable" diff --git a/standards/ci-standards.md b/standards/ci-standards.md index be3fe748e..5e8fe1dd9 100644 --- a/standards/ci-standards.md +++ b/standards/ci-standards.md @@ -46,7 +46,8 @@ reusable, not a local edit. | [`agent-shield.yml`](workflows/agent-shield.yml) | 1 | Deep agent-config security scan via `ecc-agentshield` | | [`claude.yml`](workflows/claude.yml) | 1 | Thin caller delegating to the org-level reusable Claude Code workflow | | [`dependabot-automerge.yml`](workflows/dependabot-automerge.yml) | 1 | Auto-approve and squash-merge eligible Dependabot PRs | -| [`dependabot-rebase.yml`](workflows/dependabot-rebase.yml) | 1 | Rebase Dependabot PRs on demand | +| [`auto-rebase.yml`](workflows/auto-rebase.yml) | 1 | Keep non-Dependabot PRs up-to-date with the base branch on every push to `main` | +| [`dependabot-rebase.yml`](workflows/dependabot-rebase.yml) | 1 | Update and auto-merge eligible Dependabot PRs on every push to `main` | | [`dependency-audit.yml`](workflows/dependency-audit.yml) | 1 | Multi-ecosystem audit (npm, pnpm, gomod, cargo, pip) | | [`feature-ideation.yml`](workflows/feature-ideation.yml) | 1 | BMAD Method ideation pipeline (BMAD-enabled repos only) | @@ -414,13 +415,30 @@ files, validates SKILL.md frontmatter, and detects permission bypasses. See [`workflows/agent-shield.yml`](workflows/agent-shield.yml) and the [Agent Configuration Standards](agent-standards.md) for full details. +### 8. Auto-Rebase (`auto-rebase.yml`) + +Keeps open non-Dependabot PRs up-to-date with the base branch. +A copy-paste ready template is available at [`standards/workflows/auto-rebase.yml`](workflows/auto-rebase.yml). + +**Trigger:** every `push` to `main` (i.e., every merged PR) plus manual `workflow_dispatch`. + +On each run the workflow: +1. Lists all open same-repo PRs excluding `dependabot[bot]` and fork PRs. +2. For each PR that is behind the base branch, calls `PUT /pulls/{n}/update-branch` with `merge` method to fast-forward it. +3. On `workflows` permission error: posts an idempotent comment (sentinel ``) asking the author to rebase manually. +4. On merge conflict (422): posts an idempotent comment (sentinel ``) asking the author to resolve conflicts. + +**No secrets required** — uses `GITHUB_TOKEN` only. Dependabot PRs are excluded because `dependabot-rebase.yml` handles those. + +**Compliance:** The compliance audit (`check_centralized_workflow_stubs`) verifies that repos adopting `auto-rebase.yml` use the canonical thin caller stub delegating to `petry-projects/.github/.github/workflows/auto-rebase-reusable.yml@v1`. + --- ## Conditional Workflows These workflows are required only when a specific ecosystem is detected. -### 8. Feature Ideation (`feature-ideation.yml`) — BMAD Method repos +### 9. Feature Ideation (`feature-ideation.yml`) — BMAD Method repos **Condition:** Repository has BMAD Method installed (presence of `_bmad/`, `_bmad-output/`, or equivalent BMAD planning artifacts). From 56f7d2d8bd7cba48cfdcf2a7cb1a6c3cf47ecfa4 Mon Sep 17 00:00:00 2001 From: Claude Code Date: Mon, 20 Apr 2026 20:44:54 -0700 Subject: [PATCH 4/6] fix(lint): fix markdownlint errors in ci-standards.md - Update Feature Ideation anchor fragment to #9 after section renumber - Add blank line before ordered list (MD032) --- standards/ci-standards.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/standards/ci-standards.md b/standards/ci-standards.md index 5e8fe1dd9..d5c59853f 100644 --- a/standards/ci-standards.md +++ b/standards/ci-standards.md @@ -75,7 +75,7 @@ below — copy and adapt the examples to each repo's tech stack. CodeQL is (see [§2](#2-codeql-analysis-github-managed-default-setup)). In addition, BMAD Method-enabled repositories MUST also include the conditional -[Feature Ideation workflow](#8-feature-ideation-feature-ideationyml--bmad-method-repos) +[Feature Ideation workflow](#9-feature-ideation-feature-ideationyml--bmad-method-repos) documented below — see [`standards/workflows/feature-ideation.yml`](workflows/feature-ideation.yml) for the template. @@ -423,6 +423,7 @@ A copy-paste ready template is available at [`standards/workflows/auto-rebase.ym **Trigger:** every `push` to `main` (i.e., every merged PR) plus manual `workflow_dispatch`. On each run the workflow: + 1. Lists all open same-repo PRs excluding `dependabot[bot]` and fork PRs. 2. For each PR that is behind the base branch, calls `PUT /pulls/{n}/update-branch` with `merge` method to fast-forward it. 3. On `workflows` permission error: posts an idempotent comment (sentinel ``) asking the author to rebase manually. From 500438504a87cd1fc686d4d7a228ee3a5cf3af9a Mon Sep 17 00:00:00 2001 From: Claude Code Date: Mon, 20 Apr 2026 20:50:38 -0700 Subject: [PATCH 5/6] fix(lint): use variable concatenation for multi-line comment bodies Multi-line --body strings that start continuation lines at column 1 terminate the YAML literal block scalar, causing yamllint to flag the leading ** as a syntax error. Replace both gh pr comment multi-line bodies with variable concatenation using $'\n' escapes. --- .github/workflows/auto-rebase-reusable.yml | 39 ++++++++++------------ 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/.github/workflows/auto-rebase-reusable.yml b/.github/workflows/auto-rebase-reusable.yml index f6aa47751..75a134b86 100644 --- a/.github/workflows/auto-rebase-reusable.yml +++ b/.github/workflows/auto-rebase-reusable.yml @@ -88,15 +88,15 @@ jobs: echo " Skipping — blocked comment already posted" else echo " Posting manual-rebase request (workflows permission missing)" - gh pr comment "$PR_NUMBER" --repo "$REPO" --body " -**Auto-rebase blocked** — the base branch contains \`.github/workflows/\` changes that require the \`workflows\` permission to merge into this branch, but the auto-rebase workflow's token does not have that permission. - -Please rebase this branch manually: -\`\`\` -git fetch origin -git rebase origin/$BASE_BRANCH -git push --force-with-lease -\`\`\`" + BLOCKED_BODY="" + BLOCKED_BODY+=$'\n''**Auto-rebase blocked** — the base branch contains `.github/workflows/` changes' + BLOCKED_BODY+=' that require the `workflows` permission to merge into this branch,' + BLOCKED_BODY+=" but the auto-rebase workflow's token does not have that permission." + BLOCKED_BODY+=$'\n\n''Please rebase this branch manually:' + BLOCKED_BODY+=$'\n''```'$'\n''git fetch origin' + BLOCKED_BODY+=$'\n'"git rebase origin/$BASE_BRANCH" + BLOCKED_BODY+=$'\n''git push --force-with-lease'$'\n''```' + gh pr comment "$PR_NUMBER" --repo "$REPO" --body "$BLOCKED_BODY" fi elif echo "$UPDATE_OUTPUT" | grep -qi "merge conflict"; then # Merge conflict — ask the author to resolve it. @@ -110,18 +110,15 @@ git push --force-with-lease echo " Skipping — conflict comment already posted" else echo " Posting conflict resolution request" - gh pr comment "$PR_NUMBER" --repo "$REPO" --body " -**Auto-rebase failed — merge conflict** — this branch has conflicts with \`$BASE_BRANCH\` that must be resolved manually. - -Please resolve the conflicts and push: -\`\`\` -git fetch origin -git merge origin/$BASE_BRANCH -# resolve conflicts, then: -git add . -git commit -git push -\`\`\`" + CONFLICT_BODY="" + CONFLICT_BODY+=$'\n''**Auto-rebase failed — merge conflict** — this branch has conflicts' + CONFLICT_BODY+=" with \`$BASE_BRANCH\` that must be resolved manually." + CONFLICT_BODY+=$'\n\n''Please resolve the conflicts and push:' + CONFLICT_BODY+=$'\n''```'$'\n''git fetch origin' + CONFLICT_BODY+=$'\n'"git merge origin/$BASE_BRANCH" + CONFLICT_BODY+=$'\n''# resolve conflicts, then:' + CONFLICT_BODY+=$'\n''git add .'$'\n''git commit'$'\n''git push'$'\n''```' + gh pr comment "$PR_NUMBER" --repo "$REPO" --body "$CONFLICT_BODY" fi else echo " Warning: failed to update PR #$PR_NUMBER — $UPDATE_OUTPUT" From 0fe7352fcbbe9ff96e5fbd96fad8d06f6fffc3ee Mon Sep 17 00:00:00 2001 From: Claude Code Date: Mon, 20 Apr 2026 20:55:49 -0700 Subject: [PATCH 6/6] fix(lint): use double-quoted strings to avoid SC2016 --- .github/workflows/auto-rebase-reusable.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/auto-rebase-reusable.yml b/.github/workflows/auto-rebase-reusable.yml index 75a134b86..66d77baa5 100644 --- a/.github/workflows/auto-rebase-reusable.yml +++ b/.github/workflows/auto-rebase-reusable.yml @@ -89,13 +89,13 @@ jobs: else echo " Posting manual-rebase request (workflows permission missing)" BLOCKED_BODY="" - BLOCKED_BODY+=$'\n''**Auto-rebase blocked** — the base branch contains `.github/workflows/` changes' - BLOCKED_BODY+=' that require the `workflows` permission to merge into this branch,' + BLOCKED_BODY+=$'\n'"**Auto-rebase blocked** — the base branch contains \`.github/workflows/\` changes" + BLOCKED_BODY+=" that require the \`workflows\` permission to merge into this branch," BLOCKED_BODY+=" but the auto-rebase workflow's token does not have that permission." - BLOCKED_BODY+=$'\n\n''Please rebase this branch manually:' - BLOCKED_BODY+=$'\n''```'$'\n''git fetch origin' + BLOCKED_BODY+=$'\n\n'"Please rebase this branch manually:" + BLOCKED_BODY+=$'\n'"\`\`\`"$'\n'"git fetch origin" BLOCKED_BODY+=$'\n'"git rebase origin/$BASE_BRANCH" - BLOCKED_BODY+=$'\n''git push --force-with-lease'$'\n''```' + BLOCKED_BODY+=$'\n'"git push --force-with-lease"$'\n'"\`\`\`" gh pr comment "$PR_NUMBER" --repo "$REPO" --body "$BLOCKED_BODY" fi elif echo "$UPDATE_OUTPUT" | grep -qi "merge conflict"; then @@ -111,13 +111,13 @@ jobs: else echo " Posting conflict resolution request" CONFLICT_BODY="" - CONFLICT_BODY+=$'\n''**Auto-rebase failed — merge conflict** — this branch has conflicts' + CONFLICT_BODY+=$'\n'"**Auto-rebase failed — merge conflict** — this branch has conflicts" CONFLICT_BODY+=" with \`$BASE_BRANCH\` that must be resolved manually." - CONFLICT_BODY+=$'\n\n''Please resolve the conflicts and push:' - CONFLICT_BODY+=$'\n''```'$'\n''git fetch origin' + CONFLICT_BODY+=$'\n\n'"Please resolve the conflicts and push:" + CONFLICT_BODY+=$'\n'"\`\`\`"$'\n'"git fetch origin" CONFLICT_BODY+=$'\n'"git merge origin/$BASE_BRANCH" - CONFLICT_BODY+=$'\n''# resolve conflicts, then:' - CONFLICT_BODY+=$'\n''git add .'$'\n''git commit'$'\n''git push'$'\n''```' + CONFLICT_BODY+=$'\n'"# resolve conflicts, then:" + CONFLICT_BODY+=$'\n'"git add ."$'\n'"git commit"$'\n'"git push"$'\n'"\`\`\`" gh pr comment "$PR_NUMBER" --repo "$REPO" --body "$CONFLICT_BODY" fi else