ci: run a token-free Fern docs check on fork pull requests
Author: yixinh-nvCreated Sep 8, 2026Updated Sep 8, 2026
Labelsenhancementstatus: triaged
Did you check the docs?
- I have read all the NeMo-Guardrails docs
Is your feature request related to a problem? Please describe.
The Check Fern docs job (.github/workflows/docs-build.yaml) runs make docs-fern-strict, which first regenerates the Python SDK reference through Fern's cloud and therefore needs DOCS_FERN_TOKEN. Pull requests from forks never receive repository secrets, so the job fails on every fork PR before it validates a single docs page (for example #2334 and #2366). Contributors get a red check they cannot fix, and reviewers lose the docs validation signal on exactly the PRs that most need it.
Describe the solution you'd like
- Add a
docs-fern-checkMake target that runsfern checkwithout regenerating the SDK reference. - In
build-docs, restore the.fern-cache/fern-ref-sdkcache (same keypreview-docsalready uses) so the post-checkout hook never has to generate on a cache miss, then rundocs-fern-strictwhenFERN_TOKENis present and fall back todocs-fern-checkwhen it is empty. - Keep the token-bearing path unchanged for same-repo PRs and pushes to
develop.
Describe alternatives you've considered
- Skipping the job entirely on fork PRs: loses docs validation for external contributions.
pull_request_targetto get the secret: exposes the token to untrusted PR code; rejected.- Leaving it as is: the check is not required, but a permanently red job on fork PRs is noise that hides real docs breakage.
Additional context
Split out of #2366 at CodeRabbit's out-of-scope note; the change was verified there (the job went green on a fork PR with the fallback in place).
Source: NVIDIA-NeMo/Guardrails