Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions .github/workflows/preview-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,30 @@ jobs:

- name: Create comment content
run: |
echo ":herb: **Preview your docs:** <${{ steps.generate-docs.outputs.preview_url }}>" > comment.md

PREVIEW_URL="${{ steps.generate-docs.outputs.preview_url }}"
cat > comment.md << EOF
<div align="center">
<a href="https://buildwithfern.com"><img src="https://raw.githubusercontent.com/fern-api/docs-starter/main/fern/docs/assets/fern-logo-primary.svg" height="30" alt="Fern" /></a>
<h3>✅ Preview Ready</h3>
<strong><a href="$PREVIEW_URL">Visit Preview →</a></strong>
</div>

---
EOF

if [ -n "${{ steps.page-links.outputs.page_links }}" ]; then
echo "" >> comment.md
echo "Here are the markdown pages you've updated:" >> comment.md
echo "<details>" >> comment.md
echo "<summary>📄 <strong>Changed pages</strong></summary>" >> comment.md
echo "" >> comment.md
echo "${{ steps.page-links.outputs.page_links }}" >> comment.md
echo "" >> comment.md
echo "</details>" >> comment.md
echo "" >> comment.md
fi

echo '<sub>🌿 Deployed with <a href="https://buildwithfern.com">Fern</a></sub>' >> comment.md

- name: Post PR comment
uses: thollander/actions-comment-pull-request@v2.4.3
with:
Expand Down
Loading