Repository navigation
ci: run the live-docs guard on fork pull requests without approval - #4184
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
helix-white
left a comment
There was a problem hiding this comment.
The target-event execution boundary looks sound: read-only permissions, no checkout, and both rename endpoints are validated. The PR also merges cleanly with current master.
One correctness issue needs fixing in .github/workflows/live-docs-guard.yml:38–39: GitHub's files endpoint returns at most 3,000 files, including paginated responses. A larger PR can therefore pass when the returned portion contains only book paths and an omitted path changes code. The previous complete git diff did not have this ceiling.
The proposal compares the number of returned file records with the PR's changed_files before expanding rename endpoints or deduplicating paths, and rejects incomplete results. It also shortens the rename comment.
Verified the actual shell: the original accepts a truncated 3,001-file fixture; the proposal rejects it and accepts a complete 3,000-file fixture. Pagination, forbidden paths, renames, missing metadata, and API failures passed. Live API checks reject #4180 and #4175 and accept #4155. The workflow audit, pinned Prettier 3.8.3 check, and diff whitespace check passed.
Proposed changes: https://gist.github.com/helix-a/d38ab4e82d12c43f5b6fc4e49a468860
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
helix-white
left a comment
There was a problem hiding this comment.
The completeness check in 4473fcd closes the earlier API-truncation bypass: returned file records must match changed_files before rename endpoints are expanded. No further correctness issues found; merge-tree against current master succeeds.
Re-ran the actual guard shell against truncation, complete 3,000-file responses, pagination, forbidden paths, renames, missing metadata, and API failures. Live API checks reject #4180/#4175 and accept #4155. Workflow audit, pinned Prettier 3.8.3, and diff whitespace checks pass. Automated Tests was still pending when inspected.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
The live-docs guard never ran on #4180. It listened on
pull_request, and this repository requires a maintainer to approve workflow runs for every outside contributor (approval_policy: all_external_contributors); #4180 came from a fork, its runs sat awaiting approval, and GitHub marked them failed with zero jobs when the PR merged. Thepackage-template/AGENTS.mdchange it exists to reject landed onlive-docsand was backported to master (74b29c7).The guard now listens on
pull_request_target, which runs the base branch's copy without an approval gate, so it reports as soon as a fork PR opens. It no longer checks out anything: the changed paths come fromGET /pulls/{n}/files(paginated; a rename counts its previous path too), and a list shorter than the PR'schanged_files— the endpoint stops at 3,000 — fails the check rather than passing unseen paths, so no pull request code is fetched or run under the target's token. The rule itself is unchanged. Checked locally against #4180 (rejectsprojects/start-sdk/docs/package-template/AGENTS.md), #4175 (rejects its release-notes file) and live-docs PR #4155 (passes).check-pr-retarget-workflows.pydrops the guard from thepull_requestlistener set and asserts it is apull_request_targetlistener that never usesactions/checkout; the rootAGENTS.mdretarget paragraph says the same.pull_request_targetruns the workflow from the PR's base branch, so this takes effect forlive-docsPRs oncedocs-sync-on-tag.ymlcarries the repo root there — the next product tag.🤖 Generated with Claude Code