fix(ci): use pull_request_target so fork PRs trigger opencode review - #326
Merged
Million-mo merged 1 commit intoJul 30, 2026
Merged
Conversation
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.
9 tasks
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.
Problem
The OpenCode PR Review workflow was skipped for ALL PRs (including same-repo PRs like #325).
Root cause: the workflow used
pull_requesttrigger with ahead.repo.fork == falseguard. SinceLeoyzen/agentpoolis itself a fork ofphil65/agentpool,head.repo.forkistruefor every PR, causing all runs to be skipped.Fix
pull_request→pull_request_target(runs in base repo security context, giving fork PRs access to secrets)ref: ${{ github.event.pull_request.head.sha }}to checkout step so we review the PR's actual code, not the base branchhead.repo.fork == falsefrom theifcondition — only skip draft PRsSecurity
pull_request_targetruns with base repo secrets, but this workflow only does checkout + AI review. It does not execute PR code, andpersist-credentials: falseis set. Risk is minimal.