Skip to content

feat: use --id flag with branch name for stable preview URLs#10

Open
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
devin/1773867542-preview-id-branch-name
Open

feat: use --id flag with branch name for stable preview URLs#10
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
devin/1773867542-preview-id-branch-name

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented Mar 18, 2026

Summary

Passes --id "$HEAD_REF" to fern generate --docs --preview so that repeated pushes to the same PR branch reuse the same preview URL instead of generating a new one each time.

The branch name is passed via an environment variable (HEAD_REF) rather than inline ${{ github.head_ref }} interpolation to prevent shell injection from malicious branch names.

Also bumps the Fern CLI version from 0.37.15 to 4.35.0 so the --id flag is available (added in fern-api/fern#13660, released in 4.35.0).

Review & Testing Checklist for Human

  • Version bump from 0.37.15 → 4.35.0: This is a large version jump. Verify that docs generation still works correctly with the new CLI version — there may be breaking changes or behavioral differences in the many intermediate releases.
  • Branch names with /: github.head_ref can contain slashes (e.g. feature/my-update). Slashes are invalid in DNS labels. Verify the FDR server handles or sanitizes slashes in the preview ID.
  • Test plan: Open a test PR against this repo, verify the preview URL uses the branch name. Push another commit to the same PR, verify the preview URL stays the same (not a new random UUID).

Notes

  • The || true on the fern command means a CLI failure is silently swallowed — the PR comment will have a blank link. Worth keeping in mind for debugging.

Link to Devin session: https://app.devin.ai/sessions/d3670821970e4e1687c12f99240e043e


Open with Devin

Co-Authored-By: kenny <kenny@buildwithfern.com>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration Bot and others added 2 commits March 18, 2026 21:02
Co-Authored-By: kenny <kenny@buildwithfern.com>
Co-Authored-By: kenny <kenny@buildwithfern.com>
@github-actions
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants