Skip to content

Commit bb8365d

Browse files
zhenghaxclaude
andcommitted
sync CI/preview workflows with hogepodge/fern-migration
Add push trigger for pull-request/* branches (copy-pr-bot pattern) to both workflows so they run with access to repo secrets for external contributors. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 1c95c32 commit bb8365d

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/fern-docs-preview.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Generates a shareable Fern preview URL for every docs PR and posts it as a comment.
22
# Requires the FERN_TOKEN repository secret.
3+
# Runs on pull_request events (internal contributors) and on push to pull-request/*
4+
# branches created by copy-pr-bot (external contributors), where secrets are accessible.
35
name: Fern Docs Preview
46

57
on:
@@ -43,8 +45,11 @@ jobs:
4345
uses: actions/github-script@v7
4446
with:
4547
script: |
48+
const prNumber = context.eventName === 'pull_request'
49+
? context.issue.number
50+
: parseInt(process.env.GITHUB_REF_NAME.split('/')[1]);
4651
github.rest.issues.createComment({
47-
issue_number: context.issue.number,
52+
issue_number: prNumber,
4853
owner: context.repo.owner,
4954
repo: context.repo.repo,
5055
body: `📖 **Docs preview:** ${{ steps.preview.outputs.url }}`

0 commit comments

Comments
 (0)