Commit 6324144
committed
ci: restrict credentialed Custard test job to trusted refs
The test job in custard-run.yaml runs on the workflow_run event in the
base-repository context with id-token: write and authenticates to Google
Cloud as kokoro-system-test@long-door-651. It checks out the triggering
commit and runs `make test`, which runs `npm install` and `npm test`. With
only `if: needs.affected.outputs.paths != '[]'`, a pull request opened from a
fork reaches this job, so fork-controlled npm lifecycle and test scripts run
with the service account credentials present in the workspace.
Gate the job so it runs only for trusted refs: same-repo branches on
workflow_run, plus push and workflow_dispatch. Fork pull requests no longer
execute their code in this privileged context. This matches the boundary the
legacy test job in custard-ci.yaml already enforces
(github.event.pull_request.head.repo.fork == false).1 parent 1d8c421 commit 6324144
1 file changed
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
106 | 118 | | |
107 | 119 | | |
108 | 120 | | |
| |||
0 commit comments