|
1 | 1 | name: PR Automation |
2 | 2 |
|
| 3 | +# `edited` is load-bearing, not decoration (#16776). The PR BODY is an input to |
| 4 | +# the Check Changeset job below: `check-changeset-no-major.mjs` reads the |
| 5 | +# clause-② declaration out of `github.event.pull_request.body`, and that job |
| 6 | +# refuses a PR whose declaration is unreadable while a changeset grades `patch` a |
| 7 | +# package the diff grew. A verdict whose input is the body has to re-fire when |
| 8 | +# the body changes, for the reason this file already writes out twice for labels: |
| 9 | +# the payload is a SNAPSHOT, and `rerun_failed_jobs` replays that same frozen |
| 10 | +# payload, so without `edited` a red cleared by writing `Clause-②: no` in the |
| 11 | +# body could not be cleared at all without pushing a commit. Manufacturing a |
| 12 | +# `synchronize` to get a body read is not hypothetical -- PR #16342 took a |
| 13 | +# deliberate `git merge origin/main` after a body edit for exactly that, and the |
| 14 | +# run it produced is the first measured pass in that round where the gate read |
| 15 | +# the line. |
| 16 | +# |
| 17 | +# Sibling shape, deliberately copied rather than reinvented: this repo's two |
| 18 | +# other PR-body-scoped blocking checks -- `duplicate-fix-guard.yml` and |
| 19 | +# `partof-closing-keyword-guard.yml` -- already take `edited` and already carry |
| 20 | +# this argument. |
| 21 | +# |
| 22 | +# COST, measured rather than waved at (2026-09-01..09-08, this repo's own run |
| 23 | +# counts through `GET /actions/workflows/<file>/runs?event=pull_request`): |
| 24 | +# a workflow on the DEFAULT types (`check-links.yml`, [opened, synchronize, |
| 25 | +# reopened]) recorded 1967 runs; the two `edited`-subscribed workflows above |
| 26 | +# recorded 2524 each, agreeing exactly. So `edited` is ~557 events / 8 days |
| 27 | +# (~70/day), against this workflow's own 3684 -- about +15%. One Check Changeset |
| 28 | +# job is ~46s (job 101999797457). The two jobs above it are excluded from |
| 29 | +# `edited` below, so that +15% buys exactly one job and not three. |
| 30 | +# |
| 31 | +# NOT filtered to `github.event.changes.body`, and that is deliberate. Such a |
| 32 | +# filter would trim title-only edits, and its failure direction is the defect |
| 33 | +# coming back silently -- an expression that misjudges `changes.body` on an |
| 34 | +# empty previous body stops the gate re-reading and nothing says so. The volume |
| 35 | +# above does not buy that risk. |
3 | 36 | on: |
4 | 37 | pull_request: |
5 | | - types: [opened, synchronize, reopened, labeled, unlabeled] |
| 38 | + types: [opened, synchronize, reopened, labeled, unlabeled, edited] |
6 | 39 |
|
7 | 40 | jobs: |
8 | 41 | # =========================================================================== |
@@ -96,7 +129,14 @@ jobs: |
96 | 129 | name: Check PR Size |
97 | 130 | # A `labeled`/`unlabeled` event cannot change this job's input (the diff), |
98 | 131 | # so running it there recomputes the same answer for a fee. See above. |
99 | | - if: github.event.action != 'labeled' && github.event.action != 'unlabeled' |
| 132 | + # `edited` (#16776) is excluded by the SAME sentence and not by a new one: a |
| 133 | + # title or body edit moves no file either. Excluding it also keeps this job's |
| 134 | + # behaviour byte-identical to what it was before `edited` was subscribed -- |
| 135 | + # the trigger was added for the changeset job's body reading and buys one job. |
| 136 | + if: >- |
| 137 | + github.event.action != 'labeled' |
| 138 | + && github.event.action != 'unlabeled' |
| 139 | + && github.event.action != 'edited' |
100 | 140 | runs-on: ubuntu-latest |
101 | 141 | permissions: |
102 | 142 | # `contents: read` is for the checkout the label writer needs. Declaring |
@@ -159,10 +199,15 @@ jobs: |
159 | 199 | # scans only `needs.*.outputs.*` reads, so this one is out of its scope and |
160 | 200 | # has to state its intent by hand.) |
161 | 201 | needs: pr-size |
| 202 | + # `edited` excluded for the same reason as the size job above (#16776): the |
| 203 | + # path labels are a function of the changed FILES, which a body or title edit |
| 204 | + # does not move. The `edited` trigger was added for the Check Changeset job's |
| 205 | + # body reading, and nothing here reads the body. |
162 | 206 | if: >- |
163 | 207 | !cancelled() |
164 | 208 | && github.event.action != 'labeled' |
165 | 209 | && github.event.action != 'unlabeled' |
| 210 | + && github.event.action != 'edited' |
166 | 211 | runs-on: ubuntu-latest |
167 | 212 | permissions: |
168 | 213 | contents: read |
|
0 commit comments