Commit f5f7388
committed
Add 'automated code review' label after PR creation, using GITHUB_TOKEN
When a PR is created with `gh pr create --label ...` (via the otelbot app token in code-review-sweep.yml), GitHub fires `opened` and `labeled` pull_request events within the same second. Both runs land in the build-pull-request.yml concurrency group with cancel-in-progress, so the (skipped, label-not-build-relevant) labeled run cancels the real opened run, leaving the PR with no build and a failing required-status-check (see e.g. PR #18441).
Split into two steps: create the PR (otelbot app token, so the PR is authored by otelbot), then add the label as a separate step using the default GITHUB_TOKEN. GitHub's anti-recursion rule means actions taken with GITHUB_TOKEN don't trigger workflow events, so adding the label no longer fires a labeled pull_request event and the build for the PR is no longer cancelled.1 parent f0833f0 commit f5f7388
1 file changed
Lines changed: 22 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
| 183 | + | |
182 | 184 | | |
183 | 185 | | |
184 | 186 | | |
185 | 187 | | |
186 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
187 | 195 | | |
188 | 196 | | |
189 | 197 | | |
190 | 198 | | |
191 | | - | |
192 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
193 | 213 | | |
194 | 214 | | |
195 | 215 | | |
| |||
0 commit comments