Skip to content

Fix deploy preview checkout for fork PRs#701

Merged
NullVoxPopuli merged 1 commit intouniversal-ember:mainfrom
NullVoxPopuli-ai-agent:fix-deploy-preview-fork-checkout
Apr 4, 2026
Merged

Fix deploy preview checkout for fork PRs#701
NullVoxPopuli merged 1 commit intouniversal-ember:mainfrom
NullVoxPopuli-ai-agent:fix-deploy-preview-fork-checkout

Conversation

@NullVoxPopuli-ai-agent
Copy link
Copy Markdown

Summary

The Deploy Preview workflow fails for fork PRs because actions/checkout tries to fetch the PR's head branch from the upstream repo, where it doesn't exist.

The checkout step uses ref: ${{ github.event.workflow_run.head_branch }} but doesn't specify a repository, so it defaults to github.repository (the upstream). For fork PRs the branch only exists on the fork, causing:

git fetch origin +refs/heads/<branch>*:refs/remotes/origin/<branch>*
The process '/usr/bin/git' failed with exit code 1

Fix

Add repository: ${{ github.event.workflow_run.head_repository.full_name || github.repository }} to the checkout step. This fetches from the fork repo for workflow_run events, and falls back to the current repo for workflow_dispatch (where workflow_run context doesn't exist).

Test plan

  • Trigger a deploy preview from a fork PR — should successfully check out and build
  • workflow_dispatch still works (falls back to github.repository)

🤖 Generated with Claude Code

The deploy-preview workflow checks out `workflow_run.head_branch` but
defaults to the upstream repo. For fork PRs, the branch only exists on
the fork, so `git fetch` fails with exit code 1.

Add `repository: workflow_run.head_repository.full_name` to the
checkout step so it fetches from the correct repo. Falls back to
`github.repository` for workflow_dispatch triggers where there is no
workflow_run context.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bolt-new-by-stackblitz
Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@NullVoxPopuli NullVoxPopuli merged commit 0faa832 into universal-ember:main Apr 4, 2026
1 check passed
@github-actions github-actions bot mentioned this pull request Apr 4, 2026
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.

2 participants