Skip to content

feat: add changed markdown pages to preview PR comment#96

Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1770732440-preview-changed-pages
Open

feat: add changed markdown pages to preview PR comment#96
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1770732440-preview-changed-pages

Conversation

@devin-ai-integration
Copy link
Contributor

Summary

Enhances the preview docs workflow to detect which MDX pages changed in a PR and include direct links to those pages in the preview comment. This mirrors the same feature already present in fern-api/docs's preview workflow.

What changed:

  • Added fetch-depth: 0 to checkout for full git history (needed for git diff)
  • New step queries /api/fern-docs/get-slug-for-file on the preview URL to resolve changed .mdx files to their page slugs
  • PR comment now lists links to each changed page alongside the preview URL
  • All slug resolution failures are handled gracefully — falls back to just showing the preview URL

Review & Testing Checklist for Human

  • Verify origin/main is the correct diff target — this workflow uses on: pull_request without branch restrictions, so PRs against non-main branches will still diff against origin/main. Confirm this is acceptable for the starter template.
  • Test by opening a PR that modifies an .mdx file and confirm the comment includes page links (this cannot be verified without a real PR run)
  • Confirm the /api/fern-docs/get-slug-for-file endpoint is available on preview URLs generated by the starter template's Fern config

Notes

Co-Authored-By: kenny@buildwithfern.com <kenny@buildwithfern.com>
@devin-ai-integration
Copy link
Contributor 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

@github-actions
Copy link

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