Commit 8c791bc
Run claimed PRs CI as a maintainer so it they access secrets (#1984)
## Summary
- dispatch `ci.yml` after an external contributor PR is claimed so the
mirrored internal PR can run secret-backed CI without per-maintainer
tokens
- add a PR-context loader to `ci.yml` so dispatched runs can recover
labels, PR number, and internal-head gating from the GitHub API
- keep the existing mirror/refresh flow intact while returning the owned
PR number from the claim finalization step
## Why
GitHub attributes PR authorship to the credential that creates the PR.
Because we cannot store maintainer PATs in repo secrets, the claim
workflow cannot safely recreate mirrored PRs as the approving
maintainer. The viable low-churn path is to keep the mirrored PR
bot-created, then trigger trusted CI on the mirrored branch via
`workflow_dispatch`, which can be started from `GITHUB_TOKEN` and still
runs with repository secrets.
## Impact
- claimed PRs get a trusted `ci.yml` run on their head SHA after claim
succeeds
- the CI workflow now works for both `pull_request` and dispatched
claimed-PR runs
- e2e jobs still stay gated to internal-head PRs, but that decision is
now derived from loaded PR context rather than only the event payload
## Validation
- `pnpm exec prettier --check .github/workflows/ci.yml
.github/workflows/external-contributor-pr.yml`
- `git diff --check -- .github/workflows/ci.yml
.github/workflows/external-contributor-pr.yml`
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Run trusted CI for claimed external PRs by dispatching `ci.yml` on the
mirrored branch. This keeps the mirror flow intact and enables
secret-backed CI without maintainer tokens.
- **New Features**
- `external-contributor-pr.yml` dispatches `ci.yml` after a successful
claim using the mirrored branch ref, passing the owned PR number;
exposes `claimed` and `owned-pr-number` outputs and sets `actions:
write`.
- `ci.yml` adds `workflow_dispatch` with a `pull_request_number` input
and a `load-pr-context` job to read labels, PR number, and
internal-head; this context drives eval selection, e2e gating, and
summary comments; adds `pull-requests: read`.
<sup>Written for commit 0b38370.
Summary will update on new commits. <a
href="https://cubic.dev/pr/browserbase/stagehand/pull/1984">Review in
cubic</a></sup>
<!-- End of auto-generated description by cubic. -->
---------
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>1 parent e471d2e commit 8c791bc
2 files changed
Lines changed: 98 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
12 | 18 | | |
13 | 19 | | |
14 | 20 | | |
15 | 21 | | |
| 22 | + | |
16 | 23 | | |
17 | 24 | | |
18 | 25 | | |
| |||
107 | 114 | | |
108 | 115 | | |
109 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
110 | 169 | | |
111 | | - | |
| 170 | + | |
112 | 171 | | |
113 | 172 | | |
114 | 173 | | |
| |||
137 | 196 | | |
138 | 197 | | |
139 | 198 | | |
140 | | - | |
| 199 | + | |
141 | 200 | | |
142 | 201 | | |
143 | 202 | | |
| |||
153 | 212 | | |
154 | 213 | | |
155 | 214 | | |
156 | | - | |
| 215 | + | |
157 | 216 | | |
158 | 217 | | |
159 | 218 | | |
| |||
162 | 221 | | |
163 | 222 | | |
164 | 223 | | |
165 | | - | |
| 224 | + | |
166 | 225 | | |
167 | 226 | | |
168 | | - | |
| 227 | + | |
169 | 228 | | |
170 | 229 | | |
171 | | - | |
| 230 | + | |
172 | 231 | | |
173 | 232 | | |
174 | | - | |
| 233 | + | |
175 | 234 | | |
176 | 235 | | |
177 | | - | |
| 236 | + | |
178 | 237 | | |
179 | 238 | | |
180 | | - | |
| 239 | + | |
181 | 240 | | |
182 | 241 | | |
183 | 242 | | |
| |||
510 | 569 | | |
511 | 570 | | |
512 | 571 | | |
513 | | - | |
| 572 | + | |
514 | 573 | | |
515 | 574 | | |
516 | 575 | | |
517 | 576 | | |
518 | | - | |
| 577 | + | |
519 | 578 | | |
520 | 579 | | |
521 | 580 | | |
| |||
570 | 629 | | |
571 | 630 | | |
572 | 631 | | |
573 | | - | |
| 632 | + | |
574 | 633 | | |
575 | 634 | | |
576 | 635 | | |
577 | 636 | | |
578 | | - | |
| 637 | + | |
579 | 638 | | |
580 | 639 | | |
581 | 640 | | |
| |||
732 | 791 | | |
733 | 792 | | |
734 | 793 | | |
| 794 | + | |
735 | 795 | | |
736 | 796 | | |
737 | 797 | | |
| |||
844 | 904 | | |
845 | 905 | | |
846 | 906 | | |
847 | | - | |
| 907 | + | |
848 | 908 | | |
849 | 909 | | |
850 | 910 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | | - | |
| 300 | + | |
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
| 361 | + | |
| 362 | + | |
361 | 363 | | |
362 | 364 | | |
363 | 365 | | |
| |||
562 | 564 | | |
563 | 565 | | |
564 | 566 | | |
| 567 | + | |
565 | 568 | | |
566 | 569 | | |
567 | 570 | | |
568 | 571 | | |
569 | 572 | | |
570 | 573 | | |
571 | | - | |
| 574 | + | |
572 | 575 | | |
573 | 576 | | |
574 | 577 | | |
| |||
584 | 587 | | |
585 | 588 | | |
586 | 589 | | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
587 | 608 | | |
588 | 609 | | |
589 | 610 | | |
| |||
0 commit comments