Skip to content

Commit 230f177

Browse files
authored
ci: audit workflows with zizmor (#1262)
https://woodruffw.github.io/zizmor/
1 parent 3e4bae4 commit 230f177

4 files changed

Lines changed: 45 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
- uses: actions/checkout@v4
2828
with:
2929
fetch-depth: 0
30+
persist-credentials: false
3031
- uses: actions/setup-python@v5
3132
with:
3233
cache: pip

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
- uses: actions/checkout@v4
1919
with:
2020
fetch-depth: 0
21+
persist-credentials: false
2122
- uses: actions/setup-python@v5
2223
with:
2324
cache: pip
@@ -50,6 +51,7 @@ jobs:
5051
- uses: actions/checkout@v4
5152
with:
5253
fetch-depth: 0
54+
persist-credentials: false
5355
- uses: actions/setup-python@v5
5456
with:
5557
cache: pip
@@ -67,6 +69,7 @@ jobs:
6769
- uses: actions/checkout@v4
6870
with:
6971
fetch-depth: 0
72+
persist-credentials: false
7073
- uses: actions/setup-python@v5
7174
with:
7275
cache: pip
@@ -83,6 +86,7 @@ jobs:
8386
- uses: actions/checkout@v4
8487
with:
8588
fetch-depth: 0
89+
persist-credentials: false
8690
- uses: actions/setup-python@v5
8791
with:
8892
cache: pip
@@ -108,6 +112,8 @@ jobs:
108112
os: [ubuntu-latest, macos-latest, windows-latest]
109113
steps:
110114
- uses: actions/checkout@v4
115+
with:
116+
persist-credentials: false
111117
- uses: dtolnay/rust-toolchain@stable
112118
with:
113119
components: rustfmt, clippy
@@ -141,6 +147,8 @@ jobs:
141147
runs-on: ubuntu-latest
142148
steps:
143149
- uses: actions/checkout@v4
150+
with:
151+
persist-credentials: false
144152
- uses: dtolnay/rust-toolchain@stable
145153
with:
146154
components: rustfmt

.github/workflows/pypi_upload.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
fetch-depth: 0
25+
persist-credentials: false
2526
- name: Download binary wheels
2627
id: download
2728
uses: actions/download-artifact@v4

.github/workflows/zizmor.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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 PyPI
12+
runs-on: ubuntu-latest
13+
permissions:
14+
security-events: write
15+
contents: read
16+
actions: read
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
with:
21+
persist-credentials: false
22+
23+
- name: Install the latest version of uv
24+
uses: astral-sh/setup-uv@v4
25+
26+
- name: Run zizmor 🌈
27+
run: uvx zizmor --format sarif . > results.sarif
28+
env:
29+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Upload SARIF file
32+
uses: github/codeql-action/upload-sarif@v3
33+
with:
34+
sarif_file: results.sarif
35+
category: zizmor

0 commit comments

Comments
 (0)