Commit 595b1ab
committed
fix: pin checkout ref to base SHA to prevent fork code execution
For pull_request_review events github.sha resolves to the PR head
commit (i.e. the fork's branch), so the default actions/checkout
would pull untrusted contributor code and the subsequent require()
call would execute the fork's copy of the bot script.
Explicitly set ref to github.event.pull_request.base.sha so the
checkout always lands on the verified base-branch code. Falls back
to github.sha for workflow_dispatch where pull_request is absent.
Signed-off-by: Mounil Kanakhara <mounilkankhara@gmail.com>1 parent 53b72c9 commit 595b1ab
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
0 commit comments