Skip to content

fix(ci): use pull_request_target so fork PRs trigger opencode review - #326

Merged
Million-mo merged 1 commit into
wolf1069b:mainfrom
Million-mo:fix/ci-opencode-review-trigger
Jul 30, 2026
Merged

fix(ci): use pull_request_target so fork PRs trigger opencode review#326
Million-mo merged 1 commit into
wolf1069b:mainfrom
Million-mo:fix/ci-opencode-review-trigger

Conversation

@Million-mo

Copy link
Copy Markdown
Collaborator

Problem

The OpenCode PR Review workflow was skipped for ALL PRs (including same-repo PRs like #325).

Root cause: the workflow used pull_request trigger with a head.repo.fork == false guard. Since Leoyzen/agentpool is itself a fork of phil65/agentpool, head.repo.fork is true for every PR, causing all runs to be skipped.

Fix

  • Switch trigger from pull_requestpull_request_target (runs in base repo security context, giving fork PRs access to secrets)
  • Add ref: ${{ github.event.pull_request.head.sha }} to checkout step so we review the PR's actual code, not the base branch
  • Remove head.repo.fork == false from the if condition — only skip draft PRs

Security

pull_request_target runs with base repo secrets, but this workflow only does checkout + AI review. It does not execute PR code, and persist-credentials: false is set. Risk is minimal.

The workflow used pull_request with a head.repo.fork == false guard,
but Leoyzen/agentpool is itself a fork, so the guard skipped ALL PRs.

Switch to pull_request_target (runs in base repo security context,
giving fork PRs access to secrets) and explicitly checkout the PR
head SHA to review the PR's actual code instead of the base branch.
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.

1 participant