Commit 952a541
authored
ci: gate Bonk on author_association instead of an org-membership API call (#198)
Both Bonk workflows previously authorized the triggering user with a
dedicated step that called the GitHub API at
/orgs/cloudflare/members/{user}. That required provisioning and storing a
READ_ONLY_ORG_GITHUB_TOKEN secret and cost an extra API round-trip on
every invocation.
The webhook payload already carries what we need: author_association
describes the actor's relationship to the repository, is populated by
GitHub itself (so the commenter can't forge it), and reports MEMBER for
organization members regardless of whether their membership is public.
Gating each job's `if:` on that field lets us drop the extra step and the
token entirely.
This admits MEMBER, OWNER, and COLLABORATOR. COLLABORATOR is broader than
the old org-membership check: it also includes outside collaborators who
have been granted access to this repository without being part of the
Cloudflare org. That is intentional -- anyone trusted with collaborator
access on the repo should be able to invoke Bonk -- but it is a real
widening of the trust boundary relative to the previous behavior, and
worth calling out, since these jobs run with contents/issues/
pull-requests write and the Cloudflare AI Gateway secrets.
READ_ONLY_ORG_GITHUB_TOKEN is no longer referenced by any workflow and
can be deprovisioned.1 parent 9c9ef01 commit 952a541
2 files changed
Lines changed: 14 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
13 | 18 | | |
14 | 19 | | |
15 | 20 | | |
| |||
21 | 26 | | |
22 | 27 | | |
23 | 28 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | 29 | | |
41 | 30 | | |
42 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
16 | 23 | | |
17 | 24 | | |
18 | 25 | | |
| |||
21 | 28 | | |
22 | 29 | | |
23 | 30 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | 31 | | |
41 | 32 | | |
42 | 33 | | |
| |||
0 commit comments