ci(verify-pr): register pull_request_target trigger on main - #308
Conversation
The real fullsend-verify-pr.yml (pull_request_target + ok-to-test, TC-6331) lived only on the verify-pr-fullsend feature branch; main still carried the workflow_dispatch placeholder. GitHub registers and dispatches pull_request_target from the workflow file on the DEFAULT branch (unlike pull_request, which is read from the PR base branch), so the trigger was never active: since TC-6331 merged, no verify-pr run fired for any PR — fork or same-repo (e.g. PR #307 got zero dispatch). Replace the placeholder on main with the real workflow so the event registers. A `branches: [verify-pr-fullsend]` filter scopes the rollout to PRs targeting the feature branch, so verify-pr does not yet review PRs into main; the base-branch copy still executes in trusted context. Widen/remove the filter when the feature graduates to main. Assisted-by: Claude Code Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Reviewer's GuideRegisters the real verify-pr workflow on main so GitHub can dispatch pull_request_target events, while limiting rollout to the feature branch and safely orchestrating CI-aware, fork-gated harness runs through the reusable dispatch workflow. Sequence diagram for the verify-pr pull_request_target dispatchsequenceDiagram
participant GitHub
participant Workflow as verify-pr workflow
participant Checks as PR checks
participant Dispatch as reusable-dispatch.yml
participant Harness as verify-pr harness
GitHub->>Workflow: pull_request_target
Workflow->>Checks: Wait for other PR checks
Checks-->>Workflow: Terminal conclusions
Workflow->>Workflow: Build verify-pr dispatch matrix
Workflow->>Dispatch: Invoke reusable-dispatch.yml
Dispatch->>Harness: Mint review token and run fullsend
Harness-->>Dispatch: Review result
Flow diagram for fork PR approval and verify-pr executionflowchart TD
A["Fork PR targets verify-pr-fullsend"] --> B{"ok-to-test label applied?"}
B -- No --> C["No verify-pr dispatch"]
B -- Yes --> D["pull_request_target workflow runs"]
D --> E["Wait for other PR checks"]
E --> F["Dispatch verify-pr in base-repo context"]
G["New fork PR commit"] --> H["Remove ok-to-test label"]
H --> B
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".github/workflows/fullsend-verify-pr.yml" line_range="120" />
<code_context>
+ uses: lewagon/wait-on-check-action@369769072fe522a3a8a85c03c96af1e5242a1994 # v1.9.1
+ with:
+ ref: ${{ github.event.pull_request.head.sha }}
+ running-workflow-name: wait-for-checks
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
+ wait-interval: 30
</code_context>
<issue_to_address>
**issue (bug_risk):** `wait-on-check-action` is given the job name `wait-for-checks`, but the workflow's name is `fullsend verify-pr`. The action therefore does not exclude the current workflow's check from its wait, so the check remains in progress until the 45-minute timeout and `verify-pr` never dispatches.
**Triggers:** When an eligible pull request has this workflow's check run visible on its head SHA.
**Suggested fix:** Pass the workflow name (`fullsend verify-pr`, or `${{ github.workflow }}`) if the action filters workflow names; otherwise use the action's documented input for excluding the current job/check.
```suggestion
running-workflow-name: ${{ github.workflow }}
```
</issue_to_address>Sourcery assessment
Needs a human reviewer. 1 finding to address first, and this changes a pull_request_target trust boundary and grants a PR-triggered reusable workflow broad write permissions, OIDC access, and repository secrets; a mistake in the fork or label gating could let untrusted PR activity mint credentials or modify repository state. Reverting removes the trigger, but any credentials exposed or repository changes made before the revert would not be recoverable by it.
Blocking findings: .github/workflows/fullsend-verify-pr.yml:120
Problem
Since TC-6331 merged into
verify-pr-fullsend, the verify-pr harness stopped dispatching entirely — PR #307 (and any PR) got zerofullsend-verify-pr.ymlruns.Root cause: TC-6331 switched the trigger from
pull_requesttopull_request_target. GitHub registers/dispatchespull_request_targetfrom the workflow file on the default branch (main) — unlikepull_request, which is read from the PR's base branch. The real workflow lived only onverify-pr-fullsend;mainstill carried theworkflow_dispatchplaceholder, so GitHub saw nopull_request_targettrigger and fired nothing (fork or same-repo). Nopull_request_targetrun has ever occurred in this repo.Fix
Replace the placeholder on
mainwith the real workflow so the event registers. Abranches: [verify-pr-fullsend]filter scopes the rollout to PRs targeting the feature branch — verify-pr does not yet review PRs intomain. The base-branch copy still executes in trusted base context. Widen/remove the filter when the feature graduates tomain.After merge
verify-pr-fullsend(e.g. fix(verify-pr): self-exclude own workflow check-runs from CI Status #307) dispatch on push/reopen.ok-to-test(TC-6331).synchronize/reopenedevent).🤖 Generated with Claude Code
Summary by Sourcery
Register and enable the trusted verify-pr pull request workflow on main for pull requests targeting verify-pr-fullsend.
New Features:
Bug Fixes:
Enhancements: