Skip to content

Commit 3554c7d

Browse files
authored
PYTHON-4968 Adopt zizmor GitHub Actions security scanner (#37)
1 parent 14e774f commit 3554c7d

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
uses: actions/checkout@v4
4343
with:
4444
ref: ${{ inputs.ref }}
45+
persist-credentials: false
4546
- name: Set up Python
4647
uses: actions/setup-python@v4
4748
with:

.github/workflows/dist.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
- uses: actions/checkout@v4
2323
with:
2424
ref: ${{ inputs.ref }}
25+
persist-credentials: false
2526
- name: Set up Python
2627
uses: actions/setup-python@v4
2728
with:

.github/workflows/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v2
11+
with:
12+
persist-credentials: false
1113
- uses: actions/setup-python@v4
1214
- name: "Run pre-commit"
1315
run: |
@@ -23,6 +25,8 @@ jobs:
2325

2426
steps:
2527
- uses: actions/checkout@v3
28+
with:
29+
persist-credentials: false
2630
- name: Set up Python ${{ matrix.python-version }}
2731
uses: actions/setup-python@v4
2832
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: ["master"]
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)