Skip to content

[BUG]: fern preview fails — frozen version content not populated in preview build #321

@pdmack

Description

@pdmack

Summary

Since #316 (frozen version content via git archive), the preview build workflow (fern-docs-preview-build.yml) uploads fern/ and docs/ as an artifact, but does not run git archive to populate fern/versions/v0.3.0-content/. That directory is .gitignore'd, so the artifact is empty. The companion comment workflow then fails when fern generate --docs --preview tries to resolve paths in fern/versions/v0.3.0.yml:

ENOENT: no such file or directory, open '.../fern/versions/v0.3.0-content/providers/oci.md'

Every PR that touches docs/ or fern/ has been failing preview generation since #316 merged.

Additionally, the comment workflow (fern-docs-preview-comment.yml) still uses OUTPUT=$(fern generate --docs --preview ... 2>&1) which swallows fern's error on failure (same pattern fixed in #284 for the publish workflow). The actual ENOENT is invisible in the Actions log.

Fix

  1. Add the same git archive step from the publish workflow to the preview build workflow (before artifact upload)
  2. Apply the tee-based streaming pattern to the comment workflow's Generate preview URL step

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions