Skip to content

fix(review): opt into v7 fork-PR checkout so fork reviews run - #725

Merged
max-sixty merged 1 commit into
mainfrom
fix/issue-723
Jun 23, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix/issue-723

Conversation

@tend-agent

Copy link
Copy Markdown
Collaborator

Implements option 2 from #723 per maintainer direction (implement (2)).

actions/checkout@v7 (2026-06-18) added a guard that refuses to check out a fork's refs/pull/N/{merge,head} under pull_request_target unless allow-unsafe-pr-checkout: true is set. tend-review feeds the fork ref straight to the action, so every fork PR trips the guard the moment an adopter's checkout pin drifts to v7 — the review check goes red before the review runs.

Change

  • Bump the shared checkout() macro to actions/checkout@v7 (the allow-unsafe-pr-checkout input doesn't exist on v6).
  • Add an allow_unsafe_pr_checkout parameter to the macro; tend-review sets it true, keeping the post-merge refs/pull/N/merge tree the review prefers.
  • The opt-in renders only for review. tend-mention checks out the base repo then gh pr checkouts, so it never hands the action a fork ref and needs no flag — the macro default stays false.
  • Bump the install-test workflow's checkout to v7 for consistency (same-repo only; doesn't trip the guard either way).

Rendered review step:

      - uses: actions/checkout@v7
        with:
          ref: ${{ steps.pr_ref.outputs.ref }}
          allow-unsafe-pr-checkout: true
          fetch-depth: 0
          fetch-tags: true
          token: ${{ secrets.BOT_GITHUB_TOKEN }}

This keeps the same pull_request_target + fork-code exposure tend-review has always carried (a deliberate design choice for a workflow that must inspect the contributor's tree); it just makes the opt-in explicit so v7 stops refusing it.

Tests

Updated the @v6 → @v7 assertions in test_generate.py and regenerated the regtest fixtures (pytest --regtest-reset). The flag now appears only in review fixtures; all 255 tests pass.

actions/checkout@v7 refuses to check out a fork's refs/pull/N/{merge,head}
under pull_request_target (the "pwn request" guard) unless
allow-unsafe-pr-checkout is set. tend-review feeds the fork ref straight to
the action, so every fork PR trips the guard once an adopter's checkout pin
drifts to v7 and the review check goes red before the review runs.

Per maintainer direction on #723 (option 2): bump the shared checkout macro
to @v7 and set allow-unsafe-pr-checkout: true on review's checkout, keeping
the post-merge refs/pull/N/merge tree the review prefers. The opt-in renders
only for review; mention checks out the base repo then gh pr checkouts, so it
never hands the action a fork ref and needs no flag.

Fixes #723

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@max-sixty
max-sixty merged commit 0b22561 into main Jun 23, 2026
5 checks passed
@max-sixty
max-sixty deleted the fix/issue-723 branch June 23, 2026 14:02
@max-sixty max-sixty mentioned this pull request Jun 23, 2026
max-sixty added a commit that referenced this pull request Jun 23, 2026
Bumps generator version to 0.1.7, syncs the lockfile, and adds the
`## 0.1.7` CHANGELOG section (published verbatim as the GitHub Release
notes on tag push).

Changes since 0.1.6: pin actions/checkout to v7 with review opting into
the fork-PR checkout guard (#725); bump claude-code to 2.1.185 (#719);
running-in-ci surfaces blocking scope rules instead of routing around
them (#717) and caps CI-poll loops to the Bash 10-min limit (#695);
nightly workflow-regen bases its worktree on an open PR rather than
branch-ref existence (#721); de-duplicate composite-action step bodies
under shared/steps/ with harness-named action paths (#712); correct the
codex effort list (#710); review-reviewers and worker-deploy doc fixes
(#707, #711).
max-sixty added a commit that referenced this pull request Jun 23, 2026
Stamps the 0.1.7 generator into tend's own workflows: harness-named action ref max-sixty/tend/[email protected] (#712), actions/checkout v7 with review's allow-unsafe-pr-checkout opt-in (#725), and the header version line.
max-sixty pushed a commit to max-sixty/worktrunk that referenced this pull request Jun 25, 2026
Automated nightly regeneration of tend's workflow files.

**tend version:** 0.1.6 → 0.1.7

**Notable changes:**

- **Fork-PR review checkout fixed properly** (max-sixty/tend#725) —
`tend-review` now uses `actions/checkout@v7` with
`allow-unsafe-pr-checkout: true`, the upstream-intended way to re-enable
fork-PR ref checkout that v7 blocks by default. This supersedes the
manual `actions/checkout@v6` stopgap pinned in #3176: the generator now
carries the fix, so the regen restores v7 with the explicit opt-in
rather than the downgrade.
- **CI-poll loops trimmed to fit the Bash tool's 10-min cap**
(max-sixty/tend#695) — `running-in-ci` CI-monitoring loops are sized so
they don't auto-background and drop a gated follow-up.
- **Scope blockers surfaced instead of routed around**
(max-sixty/tend#717) — when a scope rule blocks the correct action, the
bot now reports the blocker on the thread rather than silently
substituting a workaround.
- **Nightly regen worktree bases on the open PR, not the branch ref**
(max-sixty/tend#721) — keeps the regen diff incremental and the PR body
accurate.
- **Shared step scripts; actions named by harness** (max-sixty/tend#712)
— explains the regenerated comment in `tend-notifications.yaml` ("the
harness action's post-step").

Compare: max-sixty/tend@0.1.6...0.1.7

Co-authored-by: worktrunk-bot <[email protected]>
max-sixty added a commit that referenced this pull request Aug 3, 2026
…#814)

The weekly bump section covered the four `*_version` action inputs. The
third-party `uses:` refs had nothing watching them, and the reason is
worth stating: the bundled weekly skill *reviews* dependency PRs,
filtering `gh pr list` for `dependabot[bot]` and `renovate[bot]`.
Neither has ever run on this repo (`gh pr list --author app/dependabot
--state all` is empty, as is renovate's; there is no
`.github/dependabot.yml`, vulnerability alerts return 404 "disabled",
and `automated-security-fixes` is `{"enabled":false}`). So the weekly
run has been a reviewer for a bot that doesn't exist here, and a ref
only ever moved when someone needed a behavior from it —
`actions/checkout@v7` in the generator arrived in #725 to opt into v7's
fork-PR checkout, and `actions/cache@v4` has not moved since #712.

What that leaves today, from the new scan:

```
actions/cache                  v4        -> v6.1.0
actions/checkout               v6        -> v7.0.1
actions/download-artifact      v7        -> v8.0.1
actions/setup-node             v4        -> v7.0.0
actions/upload-artifact        v6        -> v7.0.1
astral-sh/setup-uv             v6        -> v9.0.0
astral-sh/setup-uv             v7        -> v9.0.0
pypa/gh-action-pypi-publish    v1.13.0   -> v1.14.2
```

An action listed twice is the signature of the failure mode: `setup-uv`
sits at v6 in `.config/tend.yaml`'s `setup:` and at v7 in `ci.yaml`,
because whoever needed v7 needed it in one file. `checkout` and
`upload-artifact` are split the same way.

The scan skips `max-sixty/tend/*`, which the release owns and "Nightly:
restamp the hand-maintained workflow refs" already covers, and the
`generator/tests` fixtures, where a bump churns regtest snapshots and
proves nothing. Results sort into two buckets because the PR shape
differs: the generator templates and the two composite actions render
into adopters' repos, so each gets its own PR naming what the majors it
crosses change; the hand-maintained workflows and `.config/tend.yaml`
reach only us and go in one.

## Why not dependabot

<details>
<summary>It would reach two of the three places these live, and this is
the one that's ours to schedule</summary>

Dependabot's `github-actions` ecosystem scans `.github/workflows` plus a
root `action.yml`, so `claude/action.yaml` and `codex/action.yaml` need
an explicit `directories:` entry
([dependabot-core#6704](dependabot/dependabot-core#6704)
is open; the workarounds are in its thread).
`generator/src/tend/templates/macros.yaml.j2` renders
`actions/checkout@v7` into every adopter's workflows and is a Jinja
template — no manager parses it, and dependabot has no regex manager.
That one is the highest-stakes ref in the repo and the least reachable,
so the rule has to cover it either way.

This also corrects the parenthetical in #811, which cited
dependabot-core#6936 as "closed not-planned". It was closed as a
duplicate of #6704, which is open. The claim that mattered there is
unaffected: dependabot updates `uses:` refs, never a `default:` under
`inputs:`, which is why the four `*_version` pins needed a skill rule.

</details>

The scan was run verbatim out of the skill file to produce the table
above.

> _This was written by Claude Code on behalf of max-sixty_

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants