Skip to content

Commit f60d88a

Browse files
authored
INTPYTHON-470 Add zizmor check (#57)
1 parent 4baf37b commit f60d88a

File tree

6 files changed

+61
-10
lines changed

6 files changed

+61
-10
lines changed

.github/workflows/_lint.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ jobs:
3333
- "3.12"
3434
steps:
3535
- uses: actions/checkout@v4
36-
36+
with:
37+
persist-credentials: false
3738
- name: Install uv
3839
uses: astral-sh/setup-uv@v5
3940
with:

.github/workflows/_release.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ jobs:
3636

3737
steps:
3838
- uses: actions/checkout@v4
39-
39+
with:
40+
persist-credentials: false
4041
- name: Install uv
4142
uses: astral-sh/setup-uv@v5
4243
with:
@@ -91,7 +92,8 @@ jobs:
9192
working-directory: ${{ inputs.working-directory }}
9293
steps:
9394
- uses: actions/checkout@v4
94-
95+
with:
96+
persist-credentials: false
9597
# We explicitly *don't* set up caching here. This ensures our tests are
9698
# maximally sensitive to catching breakage.
9799
#
@@ -180,7 +182,7 @@ jobs:
180182

181183
- name: Run unit tests with minimum dependency versions
182184
run: |
183-
uv sync --python=${{ env.PYTHON_VERSION }} --resolution=lowest-direct
185+
uv sync --python=${PYTHON_VERSION} --resolution=lowest-direct
184186
just test || git checkout uv.lock
185187
git checkout uv.lock
186188
@@ -204,6 +206,8 @@ jobs:
204206

205207
steps:
206208
- uses: actions/checkout@v4
209+
with:
210+
persist-credentials: false
207211

208212
- name: Install uv
209213
uses: astral-sh/setup-uv@v5
@@ -244,7 +248,8 @@ jobs:
244248

245249
steps:
246250
- uses: actions/checkout@v4
247-
251+
with:
252+
persist-credentials: false
248253
- name: Install uv
249254
uses: astral-sh/setup-uv@v5
250255
with:
@@ -269,5 +274,7 @@ jobs:
269274
commit: main
270275

271276
- name: Add github release url to summary
277+
env:
278+
RELEASE_URL: ${{ steps.create-release.outputs.html_url }}
272279
run: |
273-
echo "GitHub Release: ${{ steps.create-release.outputs.html_url }}" >> $GITHUB_STEP_SUMMARY
280+
echo "GitHub Release: ${RELEASE_URL}" >> $GITHUB_STEP_SUMMARY

.github/workflows/_test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ jobs:
2323
name: "run test #${{ matrix.python-version }}"
2424
steps:
2525
- uses: actions/checkout@v4
26-
26+
with:
27+
persist-credentials: false
2728
- name: Install uv
2829
uses: astral-sh/setup-uv@v5
2930
with:

.github/workflows/_test_release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ jobs:
2424

2525
steps:
2626
- uses: actions/checkout@v4
27-
27+
with:
28+
persist-credentials: false
2829
- name: Install uv
2930
uses: astral-sh/setup-uv@v5
3031
with:
@@ -73,7 +74,8 @@ jobs:
7374

7475
steps:
7576
- uses: actions/checkout@v4
76-
77+
with:
78+
persist-credentials: false
7779
- uses: actions/download-artifact@v4
7880
with:
7981
name: test-dist

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,18 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- uses: actions/checkout@v4
24+
with:
25+
persist-credentials: false
2426
- uses: actions/setup-python@v5
2527
with:
2628
python-version: '3.10'
2729
- id: files
2830
uses: Ana06/[email protected]
2931
- id: set-matrix
32+
env:
33+
FILES: ${{ steps.files.outputs.all }}
3034
run: |
31-
python .github/scripts/check_diff.py ${{ steps.files.outputs.all }} >> $GITHUB_OUTPUT
35+
python .github/scripts/check_diff.py ${FILES} >> $GITHUB_OUTPUT
3236
outputs:
3337
dirs-to-lint: ${{ steps.set-matrix.outputs.dirs-to-lint }}
3438
dirs-to-test: ${{ steps.set-matrix.outputs.dirs-to-test }}

.github/workflows/zizmor.yml

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

0 commit comments

Comments
 (0)