Fix deploy preview checkout for fork PRs#701
Merged
NullVoxPopuli merged 1 commit intouniversal-ember:mainfrom Apr 4, 2026
Merged
Conversation
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>
|
|
NullVoxPopuli
approved these changes
Apr 4, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Deploy Preview workflow fails for fork PRs because
actions/checkouttries 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 arepository, so it defaults togithub.repository(the upstream). For fork PRs the branch only exists on the fork, causing:Fix
Add
repository: ${{ github.event.workflow_run.head_repository.full_name || github.repository }}to the checkout step. This fetches from the fork repo forworkflow_runevents, and falls back to the current repo forworkflow_dispatch(whereworkflow_runcontext doesn't exist).Test plan
workflow_dispatchstill works (falls back togithub.repository)🤖 Generated with Claude Code