Skip to content

ci: run the live-docs guard on fork pull requests without approval - #4184

Merged
dr-bonez merged 2 commits into
masterfrom
ci/live-docs-guard-target
Oct 7, 2026
Merged

dr-bonez merged 2 commits into
masterfrom
ci/live-docs-guard-target

Conversation

@MattDHill

@MattDHill MattDHill commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

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. The package-template/AGENTS.md change it exists to reject landed on live-docs and 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 from GET /pulls/{n}/files (paginated; a rename counts its previous path too), and a list shorter than the PR's changed_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 (rejects projects/start-sdk/docs/package-template/AGENTS.md), #4175 (rejects its release-notes file) and live-docs PR #4155 (passes).

check-pr-retarget-workflows.py drops the guard from the pull_request listener set and asserts it is a pull_request_target listener that never uses actions/checkout; the root AGENTS.md retarget paragraph says the same.

pull_request_target runs the workflow from the PR's base branch, so this takes effect for live-docs PRs once docs-sync-on-tag.yml carries the repo root there — the next product tag.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MattDHill MattDHill added the repo Repository maintenance label Oct 7, 2026
@MattDHill
MattDHill requested a review from helix-white October 7, 2026 18:00

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@MattDHill
MattDHill requested a review from helix-white October 7, 2026 18:20

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@dr-bonez
dr-bonez merged commit d005b70 into master Oct 7, 2026
15 of 16 checks passed
@dr-bonez
dr-bonez deleted the ci/live-docs-guard-target branch October 7, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

repo Repository maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants