Commit 79adb6f
committed
ci: duplicate formal to fix posting comments
Duplicate formal so the event trigger can be set to pull_request_target
and fix posting comments. This event allows the workflow to do things
like label or comment on pull requests from forks, but it's not
recommended for build jobs due to security implications. The build jobs
still depends on formal that's why it has a duplicate one with less
privileges.
It doesn't look like there's an easy and secure way to have a workflow
with lower privileges (e.g. build) depend on workflow with higher ones
(e.g. formal or labeler that modify a PR). There's only the reverse with
going from lower privileges to higher ones with workflow_run, for
example when posting build results after a build to a PR.
Either switching existing combined workflow to pull_request_target or
splitting it into formal and build and switching build to workflow_run
gives build unsafe privileges. Splitting and switching build to
workflow_dispatch requires a custom token.
Fixes: 7658669 ("multi-arch-test-build: post formal summaries to PR")
Link: https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request_target
Link: https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
Signed-off-by: George Sapkin <[email protected]>1 parent bbaa539 commit 79adb6f
File tree
3 files changed
+45
-34
lines changed- .github/workflows
3 files changed
+45
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
2 | 3 | | |
3 | | - | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 12 | + | |
16 | 13 | | |
17 | 14 | | |
18 | | - | |
| 15 | + | |
| 16 | + | |
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | 13 | | |
| 14 | + | |
23 | 15 | | |
24 | 16 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | 17 | | |
43 | 18 | | |
44 | 19 | | |
| |||
0 commit comments