Skip to content

Fix GitHub Deployment ref for fork PRs#536

Merged
miparnisari merged 1 commit intomainfrom
fix/vercel-preview-deployment-ref
Mar 30, 2026
Merged

Fix GitHub Deployment ref for fork PRs#536
miparnisari merged 1 commit intomainfrom
fix/vercel-preview-deployment-ref

Conversation

@samkim
Copy link
Copy Markdown
Member

@samkim samkim commented Mar 30, 2026

Summary

  • Fixes the "Create GitHub Deployment" step failing with No ref found for: <branch> on fork PRs

Problem

After #535 switched the Vercel preview workflow to pull_request_target, the chrnorm/deployment-action step fails because it defaults to using the current git ref, which is now the base branch (main). The fork's branch name (e.g. fix/issue-525-crdb-fully-consistent-nuances) doesn't exist in the base repo, so the GitHub Deployments API rejects it.

Failing run: https://github.com/authzed/docs/actions/runs/23762650252/job/69233967278

Fix

Pass ref: ${{ github.event.pull_request.head.sha }} explicitly to chrnorm/deployment-action. The commit SHA is valid regardless of whether the branch exists in the base repo.

Test plan

  • Verify a fork PR preview deployment creates a GitHub Deployment without the "No ref found" error
  • Verify a collaborator PR still works as before

🤖 Generated with Claude Code

With pull_request_target the default ref is the base branch, so the
fork's branch name doesn't exist in the base repo. Pass the PR head
SHA explicitly so the GitHub Deployments API can resolve it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@samkim samkim requested a review from miparnisari March 30, 2026 19:15
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 30, 2026

Preview deployment status for this pull request.

Name Status Preview Updated (UTC)
docs 🟢 Ready Visit Preview Mar 30, 2026 07:17pm

@miparnisari miparnisari merged commit 4dfda76 into main Mar 30, 2026
10 of 11 checks passed
@miparnisari miparnisari deleted the fix/vercel-preview-deployment-ref branch March 30, 2026 19:21
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants