fix(ci): include docs/ in Fern preview artifact#290
Conversation
The Fern preview Comment workflow has been failing on every PR with `fern generate --docs --preview` returning exit 1. Root cause: the Build workflow uploads only `fern/` and `preview-metadata/` as the artifact, but `fern/docs.yml` references `../docs/index.yml`, so when the Comment workflow downloads the artifact and runs `fern generate --docs`, the relative path doesn't resolve and the generate step fails. Adding `docs/` to the upload-artifact path list makes both directories available to the Comment workflow without changing its secret-isolation boundary (it still never checks out the PR branch directly). Verified against the NVSentinel fern pipeline, which uploads both `fern/` and `docs/` and produces working preview comments on its PRs. Signed-off-by: Rob Esker <resker@nvidia.com>
Greptile SummaryThis PR fixes the broken Fern doc preview pipeline by adding Confidence Score: 5/5Safe to merge — single targeted fix with no impact outside the CI preview pipeline. The change is minimal (one path entry added to upload-artifact), the root cause is clearly diagnosed and matches the fix, and the secret-isolation design of the two-workflow pattern is preserved. No code paths or repo permissions are affected. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Bot as copy-PR-bot
participant Build as Build Workflow
participant Artifact as GitHub Artifact Store
participant Comment as Comment Workflow
participant Fern as Fern CLI
participant PR as Pull Request
Bot->>Build: push to pull-request/<n>
Build->>Build: checkout PR branch
Build->>Build: save PR metadata
Build->>Artifact: upload fern/ + docs/ + preview-metadata/
Note over Artifact: docs/ now included (this fix)
Artifact-->>Comment: workflow_run trigger (completed)
Comment->>Artifact: download fern-preview artifact
Note over Comment: gets fern/, docs/, preview-metadata/
Comment->>Fern: fern generate --docs --preview (working-dir: ./fern)
Note over Fern: resolves ../docs/index.yml successfully
Fern-->>Comment: preview URL
Comment->>PR: post/update preview comment
Reviews (1): Last reviewed commit: "fix(ci): include docs/ in Fern preview a..." | Re-trigger Greptile |
|
🌿 Preview your docs: https://nvidia-preview-pull-request-290.docs.buildwithfern.com/topograph |
PR #268 removed the `branches: [main]` push filter from `publish-fern-docs.yml` while keeping the `tags: [docs/v*]` filter. With GitHub Actions, defining `tags:` without a corresponding `branches:` restricts push events to tag refs only — branch pushes (including main) no longer trigger the workflow even when their changed paths match the `paths:` filter. Symptom: the live Fern site at https://topograph.docs.buildwithfern.com/topograph has not been republished since the manual workflow_dispatch on 2026-04-20T16:51Z. PRs #284, #289, #290, #291, and #292 all touched docs/ but produced zero workflow runs. The Reference section restored by #284 (and the clique-semantics clarifications added by #289) are on main but invisible on the published site. Restore `branches: [main]` so push events to main with docs/ or fern/ changes resume triggering publishes. Tag pushes for `docs/v*` and manual `workflow_dispatch` continue to work unchanged. To clear the backlog after this PR merges, dispatch the workflow manually one time: gh workflow run publish-fern-docs.yml --repo NVIDIA/topograph --ref main Signed-off-by: Rob Esker <resker@nvidia.com>
Description
The Fern preview
Preview Fern Docs: Commentworkflow has been failing on every PR — see the Comment workflow runs, all recent runs `conclusion=failure`. That's why PRs against this repo don't get a:herb: Preview your docs: <URL>comment the way docs-related PRs on sibling NVIDIA OSS repos do.Root cause. The
Buildworkflow uploads onlyfern/andpreview-metadata/as the artifact:```yaml
.github/workflows/fern-docs-preview-build.yml (before)
path: |
fern/
preview-metadata/
```
But
fern/docs.ymlreferences `../docs/index.yml`:```yaml
$ grep docs/ fern/docs.yml
path: ../docs/index.yml
path: ../docs/index.yml
```
So when the
Commentworkflow downloads the artifact and runs `fern generate --docs --preview`, the relative path doesn't resolve and the generate step exits 1. TheCommentworkflow intentionally never checks out the PR branch (to isolate secrets from untrusted code), so the missing directory can't be recovered there — it has to come from the artifact.Fix. Add
docs/to theupload-artifactpath list so both directories ride along into the artifact. Secret-isolation boundary is unchanged.Pattern verified against the NVSentinel Fern pipeline, which uploads both directories and produces working preview comments. Example preview on a recent NVSentinel PR: NVIDIA/NVSentinel#1226 (comment)
Checklist
make qualify— N/A (no Go/chart changes)Next preview comment
This PR should be the first one to actually receive a
:herb: Preview your docs:comment once the updatedBuildworkflow runs on thepull-request/<n>copy branch.