chore(deps): bump the github-actions group across 1 directory with 4 updates#3085
chore(deps): bump the github-actions group across 1 directory with 4 updates#3085dependabot[bot] wants to merge 1 commit into
Conversation
…updates --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: anthropics/claude-code-action dependency-version: 1.0.159 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: actions/github-script dependency-version: 9.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: zizmorcore/zizmor-action dependency-version: 0.5.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] <[email protected]>
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| ref: ${{ needs.authorize.outputs.head_sha }} | ||
| persist-credentials: false |
There was a problem hiding this comment.
🔴 actions/checkout v7.0.0's breaking change (actions/checkout#2454) refuses to check out fork-PR code from a pull_request_target-triggered workflow unless the new allow-unsafe-pr-checkout: true input is set, so this bump deterministically breaks the docs-preview build for every admin-authorized fork PR — the checkout step throws and the comment job posts a false "Preview build failed" comment. Since this workflow already implements the isolation the guard enforces (admin-gated authorize, secret-free build, artifact handoff), add allow-unsafe-pr-checkout: true to this checkout step (with a zizmor ignore if needed) or keep this one checkout at v6.
Extended reasoning...
What breaks. checkout v7.0.0's headline breaking change (actions/checkout#2454) adds a guard, assertSafePrCheckout(), that refuses to check out fork-PR head code from a pull_request_target- or workflow_run-triggered workflow unless the new allow-unsafe-pr-checkout input is explicitly set to true (it defaults to false). This PR bumps the docs-preview build job's checkout to v7 without setting that input, and this job is exactly the case the guard targets: it runs on pull_request_target and checks out ref: ${{ needs.authorize.outputs.head_sha }}, which the authorize job sets verbatim from context.payload.pull_request.head.sha.
The exact code path (verified against the pinned SHA 9c091bb, tag v7.0.0):
src/input-helper.ts(lines 75–77) reclassifies a 40-hexrefinput asresult.commitwithresult.ref = ''.src/input-helper.ts(lines 166–176) readsallow-unsafe-pr-checkout(defaultfalse) and callsassertSafePrCheckout()unconditionally during input parsing — before any fetch.src/unsafe-pr-checkout-helper.tsthrows"Refusing to check out fork pull request code from a pull_request_target workflow..."when all three hold:eventName === 'pull_request_target',pull_request.head.repo.id !== repository.id(any fork PR), and the resolved commit matchespull_request.head.sha(theprShaslist also includesmerge_commit_sha).
Step-by-step proof. A repository admin opens (or pushes to) a fork PR touching docs/**, docs_src/**, mkdocs.yml, scripts/docs/**, or pyproject.toml:
docs-preview.ymltriggers onpull_request_target;authorizeoutputshead_sha = context.payload.pull_request.head.shaandauthorized = true(admin sender).buildrunsactions/checkout@v7withref: <head_sha>→ reclassified ascommit.- Guard evaluation: event is
pull_request_target✓; head repo id ≠ base repo id (fork) ✓;input.commit === pull_request.head.sha✓ (it was passed through verbatim). All conditions met → the checkout step throws. buildfails;commentruns (always()+ authorized) withDEPLOY_RESULT != 'success'and posts "❌ Preview build failed" on the PR. Before this bump (v6.0.3) the same run built fine.
Why nothing else prevents it. The workflow already implements precisely the mitigations the v7 guard exists to enforce — admin-gated authorize job, build isolated from all secrets, static site handed to deploy via artifact, enable-cache: false — but the guard cannot see any of that; it keys only on event name + fork head-repo id + commit==head sha, all of which match here. Note also that this dependabot PR's own CI stays green: it's a same-repo PR, so the guard returns early on headRepoId === baseRepoId. The breakage is silent until the next fork-PR docs change. The /preview-docs slash-command path is unaffected (issue_comment returns early from the guard), so a manual workaround exists, but the auto-preview path is the workflow's documented primary flow.
Scope of the rest of the PR. All other bumped checkout call sites run under push/pull_request/release/issue_comment/workflow_call triggers, none of which the guard inspects — they're fine. The other three bumps are also benign: all pinned SHAs match their claimed tags (github-script v9.0.0 = 3a2844b, zizmor-action v0.5.7 = 192e21d, claude-code-action v1.0.159 = a92e7c7), and github-script v9's breaking changes (removal of require('@actions/github'), injected getOctokit) don't intersect with the inline scripts in docs-preview.yml.
Fix. Add allow-unsafe-pr-checkout: true to the build job's checkout step in docs-preview.yml (likely with a zizmor ignore comment mirroring the existing dangerous-triggers ignore), or hold this one checkout at v6. One line either way.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore <dependency name> major versionwill close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)@dependabot ignore <dependency name> minor versionwill close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)@dependabot ignore <dependency name>will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)@dependabot unignore <dependency name>will remove all of the ignore conditions of the specified dependency@dependabot unignore <dependency name> <ignore condition>will remove the ignore condition of the specified dependency and ignore conditions