Skip to content

Commit 6b19a0f

Browse files
committed
[nrf noup] ci: prevent PRs from installing python pkgs
pip install requirements-actions.txt from base branch instead of untrusted PR During install a malicious package can execute code in setup.py Signed-off-by: Thomas Stilwell <[email protected]>
1 parent 20d89eb commit 6b19a0f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/workflows/manifest.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Manifest
22
on:
33
pull_request_target:
4+
branches:
5+
- main
46

57
permissions:
68
contents: read
@@ -16,7 +18,7 @@ jobs:
1618
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1719
with:
1820
path: zephyrproject/zephyr
19-
ref: ${{ github.event.pull_request.head.sha }}
21+
ref: ${{ github.event.pull_request.base.sha }}
2022
fetch-depth: 0
2123
persist-credentials: false
2224

@@ -32,6 +34,14 @@ jobs:
3234
cd zephyrproject/zephyr
3335
pip install -r scripts/requirements-actions.txt --require-hashes
3436
37+
- name: Checkout the code
38+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
39+
with:
40+
path: zephyrproject/zephyr
41+
ref: ${{ github.event.pull_request.head.sha }}
42+
fetch-depth: 0
43+
persist-credentials: false
44+
3545
- name: west setup
3646
env:
3747
BASE_REF: ${{ github.base_ref }}

0 commit comments

Comments
 (0)