Skip to content

Split preview workflow to support fork PRs#50

Open
benhayes21 wants to merge 1 commit into
mainfrom
fix/fork-pr-preview-workflow
Open

Split preview workflow to support fork PRs#50
benhayes21 wants to merge 1 commit into
mainfrom
fix/fork-pr-preview-workflow

Conversation

@benhayes21

@benhayes21 benhayes21 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Closes #51

Summary

  • Splits the single build-preview.yml workflow into two: a build step and a deploy step
  • Build runs on pull_request (no secrets needed — safe for forks)
  • Deploy runs on workflow_run after build completes (runs in base repo context, has access to secrets)
  • PRs from external forks will now get preview deployments without needing repo access

Why

GitHub doesn't pass secrets to workflows triggered by fork PRs (security measure). The previous single workflow broke for any external contributor's PR.

Test plan

  • Verify a fork PR triggers the build workflow successfully
  • Verify the deploy workflow runs after and deploys the preview
  • Verify closing a fork PR removes the preview

🤖 Generated with Claude Code

Secrets are not passed to workflows triggered by fork pull requests.
Splitting into a build step (pull_request, no secrets) and a deploy
step (workflow_run, has secrets) allows external contributors to get
preview deployments without needing repo access.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Preview deployments fail for fork PRs

2 participants