Fix PR preview responder setting correct origin remote#2528
Fix PR preview responder setting correct origin remote#2528wwwillchen-bot merged 1 commit intodyad-sh:mainfrom
Conversation
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
Greptile OverviewGreptile SummaryThis PR adjusts the PR Review Responder workflow to keep pushes targeting the PR head repository when the Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
autonumber
participant CI as CI workflow
participant PRRR as PR Review Responder (workflow_run)
participant GHAPI as GitHub API
participant CO as actions/checkout
participant GIT as git
participant CCA as claude-code-action
CI-->>PRRR: workflow_run(completed)
PRRR->>GHAPI: pulls.get / pulls.list (resolve pr_number & labels)
GHAPI-->>PRRR: PR details
PRRR->>CO: checkout head_repository/head_branch
CO-->>PRRR: repo checked out (origin set)
PRRR->>GIT: record HEAD sha
PRRR->>GIT: set origin pushurl to head_repo (new)
PRRR->>CCA: run /dyad:pr-fix
CCA-->>GIT: may commit & push
PRRR->>GHAPI: gh pr view headRefOid
PRRR-->>PRRR: if sha changed, re-trigger workflows
PRRR->>GHAPI: gh workflow run (ci/bugbot/claude-pr-review)
PRRR->>GHAPI: update PR labels (pending/done/failed/re-request)
|
Additional Comments (1)
Prompt To Fix With AIThis is a comment left during a code review.
Path: .github/workflows/pr-review-responder.yml
Line: 149:155
Comment:
**Unconditional `head_repository` deref**
`core.setOutput('head_repo', run.head_repository.full_name);` runs unconditionally in the github-script step. In `workflow_run` payloads `run.head_repository` can be `null` (you already note/handle this in the fallback branch), so this line will throw and fail the workflow whenever the head repo isn’t available (e.g., fork deleted). Consider guarding this output (and anything depending on it) the same way you guard the fallback path, or deriving `head_repo` from the fetched `pr` object instead.
How can I resolve this? If you propose a fix, please make it concise. |
#skip-bb
Summary by cubic
Fixes the PR review responder so pushes go to the PR’s fork instead of the base repo on forked PRs. Exposes the head repository and sets origin’s pushurl to ensure correct push behavior.
Written for commit 9ca4297. Summary will update on new commits.