ci: build the website on pull requests - #2059
Merged
Merged
Conversation
janicduplessis
commented
Sep 30, 2026
janicduplessis
left a comment
Collaborator
Author
There was a problem hiding this comment.
Review of the docs.yml change. No blocking issues found.
Checked and correct:
- Deploy gating:
deployis skipped onpull_request, so nogithub-pagesenvironment run, deployment or protection prompt occurs on PRs.pushandworkflow_dispatchstill deploy. - Concurrency: on push, dispatch and schedule the expression evaluates to
docs-pages, the same group as before, so main deploys still serialize. PRs getdocs-refs/pull/N/merge.cancel-in-progress: falseholds one running plus one pending run per PR (older pending runs are replaced), which is fine. - Fork PRs: the workflow-level
pages: write/id-token: writedo not fail a fork run. GITHUB_TOKEN is capped to read-only there, andbuildonly needscontents: readfor checkout. No secrets are used. - Path filter: the
pull_requestfilter matches the push filter. The build's inputs arewebsite/**,docs/releases/**(gen-changelog.mjs) andpackages/stim-cli/src/guide/errors.ts(gen-troubleshooting.mjs, which imports only./types.ts), all covered. - Artifact upload on PRs:
upload-pages-artifactruns on PRs. It is harmless (per-run artifact, deploy skipped).
Minor, non-blocking:
- The workflow declares
pages: writeandid-token: writeat the top level, so the PR build job holds them on same-repo PRs, which run PR-controlled code (pnpm install, docusaurus build). No secret is exposed and the token cannot deploy without thedeployjob. Moving those two permissions to thedeployjob (top-levelcontents: read) would follow least privilege, but that is optional here. - The path filter means the check does not report on PRs that touch none of those paths. Nothing is required today (main has no required status checks, only a ruleset with
deletionandnon_fast_forward), so nothing blocks. If Docs is made a required check later, the skipped-by-filter case would hang merges. - The website build can also be affected by files outside the filter only if
website/starts importing further from elsewhere. Thepackages/stim-cli/src/guide/**filter is broader than needed (onlyerrors.tsis imported), which is safe. - The
upload-pages-artifactstep could be gated withif: github.event_name != 'pull_request'to avoid uploading an unused artifact on every PR run. Optional.
The test plan (bare <Foo> failing the build) is enough to confirm the new gate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The website build ran only in
docs.ymlon push to main, so a pull request that broke MDX underwebsite/docs/merged green and failed the Docs deploy afterward (#1839, fixed by #2057).Solution
docs.ymlnow also triggers onpull_requestwith the same path filter as the push trigger, which includes the workflow file itself. The existingbuildjob runs on pull requests. Thedeployjob is skipped on pull requests, and the concurrency group is per ref for pull requests so they do not queue behind Pages deploys. Thepages: writeandid-token: writepermissions move from the workflow to thedeployjob, so PR builds run with read-only permissions.Test plan
docs.yml.<Foo>to a doc; the Docs build must fail. The commit is then reverted and the build must pass.Fixes #2058