Commit 671e00b
authored
Harden CI workflow: switch to pull_request trigger and remove unnecessary id-token:write (#214)
Addressing two issues in the CI workflow:
1. **`pull_request_target` > `pull_request`**: Fork PRs currently run in
the base repo's execution context. Switching to pull_request runs fork
PRs in the fork's context, which matches the workflow's declared
read-only permissions and is the recommended trigger for CI jobs that
don't need write access to the base repo.
(Some references:
-
https://docs.github.com/en/enterprise-cloud@latest/actions/reference/security/secure-use#mitigating-the-risks-of-untrusted-code-checkout
-
https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
)
2. **Remove `id-token: write`**: No active job uses OIDC. This
permission is a leftover from the commented-out `online-test` job and
grants unnecessary token-minting capability.
No CI behavior change. All active jobs (`check`, `format`,
`offline-test`) only need `contents: read` and `pull-requests: read`,
which work identically with `pull_request`.1 parent 29f68bb commit 671e00b
1 file changed
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
0 commit comments