Commit 7feaef4
ci(unity-tests): harden pull_request_target and gate artifact upload
Address CodeRabbit security review on #1103:
- persist-credentials: false on the checkout step, so GITHUB_TOKEN is
not written to disk and cannot be read by subsequent steps running
PR-controlled code.
- Explicit permissions: contents: read on the testAllModes job, scoping
the workflow's token down from the default read/write set.
- Skip upload-artifact when the main test step was skipped (e.g.,
because the preceding domain-reload step failed without
continue-on-error). Avoids the noisy "No files were found" error
on top of an already-failed run.
The label-gated trigger plus these mitigations narrow the blast radius
of the pull_request_target + checkout-PR-head pattern. The remaining
trust boundary is the maintainer review before applying safe-to-test;
documenting the review checklist (especially TestProjects/UnityMCPTests
diffs) is a follow-up.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent c641c8c commit 7feaef4
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| 55 | + | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
| |||
130 | 133 | | |
131 | 134 | | |
132 | 135 | | |
133 | | - | |
| 136 | + | |
134 | 137 | | |
135 | 138 | | |
136 | 139 | | |
0 commit comments