Skip to content

Commit 7c4cf76

Browse files
authored
PYTHON-4970 Adopt zizmor GitHub Actions security scanner (#251)
1 parent ce37053 commit 7c4cf76

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

.github/workflows/benchmark.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
fail-fast: false
2323
steps:
2424
- uses: actions/checkout@v4
25+
with:
26+
persist-credentials: false
2527
- name: Setup Python
2628
uses: actions/setup-python@v5
2729
with:

.github/workflows/release-python.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
uses: actions/checkout@v4
4646
with:
4747
fetch-depth: 0
48+
persist-credentials: false
4849

4950
- name: Set up python version
5051
run: |
@@ -99,6 +100,7 @@ jobs:
99100
- uses: actions/checkout@v4
100101
with:
101102
fetch-depth: 0
103+
persist-credentials: false
102104

103105
- uses: actions/setup-python@v5
104106
with:

.github/workflows/test-python.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222

2323
steps:
2424
- uses: actions/checkout@v4
25+
with:
26+
persist-credentials: false
2527
- uses: actions/setup-python@v5
2628
- uses: pre-commit/[email protected]
2729
with:
@@ -38,6 +40,8 @@ jobs:
3840
name: CPython ${{ matrix.python-version }}-${{ matrix.os }}
3941
steps:
4042
- uses: actions/checkout@v4
43+
with:
44+
persist-credentials: false
4145
- name: Setup Python
4246
uses: actions/setup-python@v5
4347
with:
@@ -93,6 +97,8 @@ jobs:
9397
runs-on: ubuntu-latest
9498
steps:
9599
- uses: actions/checkout@v4
100+
with:
101+
persist-credentials: false
96102
- name: Setup Python
97103
uses: actions/setup-python@v5
98104
with:

.github/workflows/zizmor.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: GitHub Actions Security Analysis with zizmor
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["**"]
8+
9+
jobs:
10+
zizmor:
11+
name: zizmor latest via Cargo
12+
runs-on: ubuntu-latest
13+
permissions:
14+
security-events: write
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
persist-credentials: false
20+
- name: Setup Rust
21+
uses: actions-rust-lang/setup-rust-toolchain@v1
22+
- name: Get zizmor
23+
run: cargo install zizmor
24+
- name: Run zizmor
25+
run: zizmor --format sarif . > results.sarif
26+
env:
27+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
- name: Upload SARIF file
29+
uses: github/codeql-action/upload-sarif@v3
30+
with:
31+
sarif_file: results.sarif
32+
category: zizmor

0 commit comments

Comments
 (0)