Skip to content

Runbook gotcha: any fix to squad-repo-health.yml is unverifiable in CI until it merges #1800

Description

@bradygaster

The property

.github/workflows/squad-repo-health.yml is permanently self-blocking: a pull request that fixes this workflow is always tested against the old, unfixed copy.

Two mechanisms combine:

  1. on: pull_request_target — GitHub takes the workflow definition from the base branch, not from the PR head. This is inherent to the trigger.
  2. The workflow then deliberately checks out base-branch scripts as well. There is no ref: override on any of its four checkout steps (only fetch-depth: 0), and there is a # SAFETY: comment explaining that this is intentional — running untrusted PR code under pull_request_target's elevated token would be a security hole.

Both choices are correct. The consequence is not a bug to fix, it is a property to know about.

Why it matters

The only pre-merge signal available for a change to this workflow is "the job didn't crash."

That is exactly the weak signal that let #1770 live undetected. A crashed github-script reporter is indistinguishable from a clean run to anyone skimming the checks list — it fails the class of finding it exists to catch, silently.

How it showed up

#1770 fixed three repo-health reporters that crashed on any finding message containing a backtick. On the PR that fixed it (#1786), Repo Health / Security Review — Permissions & Secrets was red at head with:

##[error]Unhandled error: SyntaxError: Unexpected identifier 'git'
    at new AsyncFunction (<anonymous>)
    at callAsyncFunction (.../github-script/dist/index.js:64949:16)

The fix was verified complete on the branch — zero remaining backtick-literal interpolation sites, all three reporters moved to the env:/process.env boundary. It simply had no effect, because dev's copy is what ran.

FIDO hit the same wall independently on #1792.

What to do when you touch this workflow

  • Expect the check to be red or misleading. Do not read a green Repo Health on such a PR as evidence the fix works; do not read a red one as evidence it doesn't.
  • Verify locally instead. Run the scanner directly (node scripts/security-review.mjs) and compile the script: bodies out of the real YAML — test/scripts/repo-health-comment-transport.test.ts (added in fix(ci): stop splicing repo-health report content into github-script bodies #1786) does exactly this and is the intended substitute for the missing CI signal.
  • Satisfy the gate on its own terms. If your PR's own diff trips a repo-health rule, reword the diff. Do not add an ignore entry, lower a severity, or add a path exclusion to get green.
  • Re-verify immediately after merge, since that is the first moment the fix is actually live.

Placement

Belongs in the runbook family alongside gotcha #10.

Related: #1770, #1786, #1792.

Activity

  1. github-actions commented on Sep 11, 2026

    @github-actions
    Contributor

    🔄 Ralph — Auto-Triage

    Assigned to: RETRO
    Reason: Matched routing keyword(s): security, security review
    Source: routing-rule

    Ralph auto-triaged this issue using routing rules.
    To reassign, swap the squad:* label.

  2. github-actions commented on Sep 13, 2026

    @github-actions
    Contributor

    🔄 Ralph — Auto-Triage

    Assigned to: security-reviewer
    Reason: Matched routing keyword(s): Security review, security, review, secrets
    Source: routing-rule

    Ralph auto-triaged this issue using routing rules.
    To reassign, swap the squad:* label.

  3. added
    squad:agentic-workflows-devAssigned to agentic-workflows-dev (Agentic Workflows Engineer)
    and removed
    squad:security-reviewerAssigned to security-reviewer (Security Reviewer)
    on Sep 24, 2026
  4. github-actions commented on Sep 24, 2026

    @github-actions
    Contributor

    🔄 Ralph — Auto-Triage

    Assigned to: security-reviewer
    Reason: Matched routing keyword(s): Security review, security, review, secrets
    Source: routing-rule

    Ralph auto-triaged this issue using routing rules.
    To reassign, swap the squad:* label.

  5. github-actions commented on Sep 24, 2026

    @github-actions
    Contributor

    📋 Assigned to agentic-workflows-dev (Agentic Workflows Engineer)

    Issue: #1800 — Runbook gotcha: any fix to squad-repo-health.yml is unverifiable in CI until it merges

    agentic-workflows-dev will pick this up in the next Copilot session.

    For Copilot coding agent: If enabled, this issue will be worked automatically.
    Otherwise, start a Copilot session and say:
    agentic-workflows-dev, work on issue #1800

  6. bradygaster commented on Sep 28, 2026

    @bradygaster
    CollaboratorAuthor

    Post-merge Repo Health canary evidence

    Acceptance verdict: FAIL (issue remains open). The reporter preserved the semantic filename via Git's canonical C-quoted representation, but the runbook requires the literal assertion marked[0].body.includes(expected). That assertion is false because the diagnostic contains outer C-quote characters and backslash-escaped embedded double quotes. Remaining blocker: decode Git C-quoted paths before rendering, or explicitly revise the runbook's literal exact-filename contract and re-run the authoritative canary.

  7. added a commit that references this issue on Sep 28, 2026
  8. bradygaster commented on Sep 28, 2026

    @bradygaster
    CollaboratorAuthor

    Reopened after #2101 merged because the documented acceptance criterion still requires a fresh authoritative post-fix detection and cleanup canary. The merge keyword closed this issue before that evidence existed. Close only after exact semantic hostile-path detection, authoritative marker verification, cleanup verification, and run URLs are recorded.

  9. bradygaster commented on Sep 28, 2026

    @bradygaster
    CollaboratorAuthor

    Authoritative post-merge Repo Health canary — PASS

    PR #2101 is present on live origin/dev at merge SHA 09042a7adbdad9a7759cdd338a4deb98679a31ef (merged 2026-09-28T23:44:03Z), including commit 14fad3d9ebcc2f06876a583b3e3e332a9e8eafc3 (fix(repo-health): decode Git-quoted leakage paths).

    .squad/canary-`paired`-${-apostrophe-'-"double quote".md
    

    All criteria in the live origin/dev:.github/REPO_HEALTH_RUNBOOK.md passed. Closing #1800.

  10. added 3 commits that reference this issue on Sep 28, 2026
    251e256
    25c5d7f
    14fad3d
  11. added a commit that references this issue on Oct 20, 2026
    c24da2a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    squadSquad triage inbox — Lead will assign to a membersquad:agentic-workflows-devAssigned to agentic-workflows-dev (Agentic Workflows Engineer)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions