Skip to content

Fix deploy preview workflow_dispatch by resolving PR info upfront#705

Merged
NullVoxPopuli merged 1 commit into
universal-ember:mainfrom
NullVoxPopuli-ai-agent:fix-deploy-preview-workflow-dispatch
Apr 5, 2026
Merged

Fix deploy preview workflow_dispatch by resolving PR info upfront#705
NullVoxPopuli merged 1 commit into
universal-ember:mainfrom
NullVoxPopuli-ai-agent:fix-deploy-preview-workflow-dispatch

Conversation

@NullVoxPopuli-ai-agent
Copy link
Copy Markdown

Summary

The deploy preview workflow uses github.event.workflow_run context for branch name, repo, and PR number — but these are all empty for workflow_dispatch triggers, causing:

  • Empty ref on checkout → builds main instead of the PR branch
  • Empty --branch on Cloudflare deploy → wrangler crashes
  • Missing PR number on sticky comment

Fix

Centralize PR info resolution in determinePR. For workflow_dispatch, use gh pr view to look up the branch and repo from the PR number input. Pass branch, repo, and number as job outputs consumed by Build, Deploy, and PostComment.

Test plan

  • workflow_dispatch with PR number → checks out correct branch, deploys, posts comment
  • workflow_run from CI → same behavior as before (uses workflow_run context)

🤖 Generated with Claude Code

The deploy preview workflow uses workflow_run context for branch name,
repo, and PR number — but these are all empty for workflow_dispatch
triggers, causing:
- Empty ref on checkout (defaults to main instead of PR branch)
- Empty --branch on Cloudflare deploy (wrangler fails)
- Missing PR number on sticky comment

Fix by centralizing PR info resolution in determinePR:
- For workflow_dispatch: look up branch/repo from the PR number input
  via gh pr view
- For workflow_run: use the existing workflow_run context
- Pass branch, repo, and number as job outputs consumed by all
  downstream jobs

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 1c5b91a into universal-ember:main Apr 5, 2026
5 checks passed
@github-actions github-actions Bot mentioned this pull request Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants