Repository navigation
Conversation
The scan diffs BASE..HEAD two-dot, so it reads two trees. Its checkout fetched full history with every blob, about 3 GB, and on 11-03 every run since 15:00Z was cancelled in actions/checkout at the job's 10-minute limit. Check out at depth 2 and fetch a missing end by id, with all of its files, failing closed when it cannot be fetched.
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. The two-dot diff only reads two trees, both ends are fetched in full with no partial-clone filter, and the step fails closed if either end cannot be fetched. Notes
[DESIGN-REVIEWED] 8538c9a Description read[DESCRIPTION-READ] 72c69c03703a2e6da14596a5a22586b2e6a9fbe896050978eebf3077e82802ae That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. Every item comes from the measured checkout cancellations. The deleted allowlist pin is replaced by the event-shaped fetch it said was missing. Notes
What this change shipsInventory (5 items) — 4 justifiedIntent: let Internal Content Scan finish within its 10-minute limit instead of being cancelled during a full-history checkout. FIX.
[FIRST-PRINCIPLES-REVIEWED] 8538c9a Description read[DESCRIPTION-READ] 3bcf693a83a629681fa08abe5363428bd48743ed176711a7db4fd2d1d5c60050 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
|
Live evidence on head 8538c9a: this PR's own Internal Content Scan Gate run 41705705357 passed. Checkout (depth 2) took 117 s, the diff step under 1 s (range 4edd445...0d75b16, 261 diff lines; the base was the merge commit's first parent, so no extra fetch). In the same window, the ten full-clone runs started 19:34-19:41Z on other branches and main were all cancelled in checkout at 10 minutes. The 117 s for two commits suggests GitHub's fetch is slow today in general; the shallow fetch still fits the budget the full one cannot. |
|
Closing: #29301 merged at 20:53Z (4e44f73) and now owns this checkout ( |
Problem / Motivation
Goal: Internal Content Scan stops being cancelled at its 10-minute limit while
actions/checkoutdownloads the whole repository.On 2026-11-03, since 15:00Z, 17 Internal Content Scan Gate runs were cancelled and none succeeded, across many PRs (for example run 41690485822 on #29261 and run 41684185557 on #29192). Each was cancelled inside
actions/checkoutat the job'stimeout-minutes: 10. That checkout wasfetch-depth: 0: every branch and every blob ever committed, about 3 GB (#27513 measured 2.87 GiB).Why it matters
Internal Content Scan is a required, blocking lane. A cancelled run publishes no verdict, so PR Readiness stays red on PRs whose code is fine, and each hit costs a rerun or a fresh push that restarts every check.
Not a goal
main-ratchet-audit.yml's checkout, tracked in ci: main-ratchet-audit clones every historical blob for gates that read only the working tree #28443 / ci: skip history blobs in main-ratchet-audit's checkout #28459.release.yml's Stable publication gate (see "What changed").fork-internal-content-scan.yml, whose three-dot diff needs a merge-base.What changed (motivation → approach → change)
Symptom: the scan job is cancelled in checkout. Cause: the job diffs
git diff --unified=0 "$BASE" "$HEAD", two-dot, so it reads exactly two trees, yet its checkout downloads the full history with all blobs.fetch-depth: 0fetch-depth: 2(the checked-out commit and its parent)--depth=1, all files, 3 attemptsgit difffailscould not fetch <sha>; failing closed.git diff --unified=0 BASE HEADPer event shape (the callee serves all three that
internal-content-scan-gate.ymldelivers):push: HEAD is the checkout;beforeis fetched by id. A branch's first push falls back toHEAD^, which depth 2 already has.pull_request: HEAD is the merge commit (the checkout);base.shais fetched by id.merge_group: HEAD is the group head (the checkout);base_shais fetched by id.Why the gate stays as strong:
git diffreads only the two commits' trees, so it sees the same lines a full clone gives.filter: blob:noneon diff-reading gates; it does not apply here.The fetch sends the job's own
github.token(contents: read) as a maskedhttp.extraheader, the same formfork-internal-content-scan.ymluses, so a private calling repository can still fetch its own commits. Checkout keepspersist-credentials: false.release.ymlis left out on purpose. Its Stable publication gate readsrefs/tags/v$VERSION, the tagged tree's version files andCHANGELOG.md, and its promotion check depends on how that tag resolves. Proving that a shallow checkout resolves the tag the same way under every release trigger is a separate, security-sensitive change, and its run 41672019878 passed on attempt 2.Backwards compatibility
Compatible: the scan reads the same two trees and produces the same diff for every event shape; only how the objects arrive changes.
Removes nothing: no step, output, check or ruleset input is removed;
test_workflow_bounded_checkout.py's allowlist loses the entry this job no longer needs.Tests
test/test_internal_content_scan_checkout.py(new): builds a local origin, checks out at depth 2 asactions/checkoutdoes, runs the step's realrun:body, and compareschange.diffwith a full clone's forpush, a branch's first push,pull_requestandmerge_group. An unfetchable end fails the step and writes no diff. The checkout carries no filter.test/test_workflow_bounded_checkout.py:internal-content-scan.yml/scanis no longer allowed to keepfetch-depth: 0under a tight timeout.test_workflow_*.py,test_release_*.py, the fleet-routing and watchdog workflow tests: 1012 passed. The 7 errors aretest_workflow_injection_identity.pyasking for a missingevent_loopfixture in this environment, unrelated to workflow YAML.Proof: PROVEN test/test_internal_content_scan_checkout.py::test_the_checkout_is_two_commits_and_the_diff_step_comes_right_after, test/test_internal_content_scan_checkout.py::test_the_diff_matches_a_full_clone[push], test/test_internal_content_scan_checkout.py::test_the_diff_matches_a_full_clone[pull_request], test/test_internal_content_scan_checkout.py::test_the_diff_matches_a_full_clone[merge_group], test/test_internal_content_scan_checkout.py::test_an_end_that_cannot_be_fetched_fails_the_step (head 8538c9a)
Manual verification
This PR's own Internal Content Scan Gate run exercises the
pull_requestshape on the real runner. actionlint is not installed here, so it was not run locally.Related Issues
Related #29264, #28443
Sibling sweep
Swept: git grep -n "fetch-depth: 0" -- .github/workflows
Sibling: .github/workflows/internal-content-scan.yml -- changed here
Sibling: .github/workflows/security-scope-review.yml -- tracked in #29264
Sibling: .github/workflows/fork-security-scope-review.yml -- tracked in #29264
Sibling: .github/workflows/main-ratchet-audit.yml -- tracked in #28443
Sibling: .github/workflows/release.yml -- not affected -- stable gate resolves a tag; left out, see What changed
Sibling: .github/workflows/fork-internal-content-scan.yml -- not affected -- three-dot diff needs the merge-base history
Sibling: .github/workflows/add-contributor.yml -- not affected -- reads git log across merged history
Pattern harvest
Rule candidate: lint
Pattern: a job checks out
fetch-depth: 0when its steps read only two named commits' treesChecklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.