Skip to content

Commit d6c2ad7

Browse files
committed
Add the zizmor setup here as well.
1 parent af9a857 commit d6c2ad7

File tree

3 files changed

+52
-10
lines changed

3 files changed

+52
-10
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,21 @@ on:
1212
- cron: "21 3 * * *"
1313
workflow_dispatch:
1414

15+
permissions: {}
16+
1517
jobs:
1618
list:
1719
runs-on: ubuntu-latest
1820
outputs:
1921
noxenvs: ${{ steps.noxenvs-matrix.outputs.noxenvs }}
2022
steps:
2123
- uses: actions/checkout@v4
24+
with:
25+
persist-credentials: false
2226
- name: Set up uv
23-
uses: astral-sh/setup-uv@v6
27+
uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb
2428
with:
25-
enable-cache: true
29+
enable-cache: ${{ github.ref_type != 'tag' }} # zizmor: ignore[cache-poisoning]
2630
- id: noxenvs-matrix
2731
run: |
2832
echo >>$GITHUB_OUTPUT noxenvs=$(
@@ -72,6 +76,8 @@ jobs:
7276

7377
steps:
7478
- uses: actions/checkout@v4
79+
with:
80+
persist-credentials: false
7581
- name: Install dependencies
7682
run: sudo apt-get update && sudo apt-get install -y libenchant-2-dev
7783
if: runner.os == 'Linux' && startsWith(matrix.noxenv, 'docs')
@@ -94,12 +100,12 @@ jobs:
94100
if: runner.os == 'Windows' && startsWith(matrix.noxenv, 'tests')
95101

96102
- name: Set up uv
97-
uses: astral-sh/setup-uv@v6
103+
uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb
98104
with:
99105
enable-cache: true
100106

101107
- name: Run nox
102-
run: uvx nox -s "${{ matrix.noxenv }}" -- ${{ matrix.posargs }}
108+
run: uvx nox -s "${{ matrix.noxenv }}" -- ${{ matrix.posargs }} # zizmor: ignore[template-injection]
103109

104110
packaging:
105111
needs: ci
@@ -116,8 +122,9 @@ jobs:
116122
- uses: actions/checkout@v4
117123
with:
118124
fetch-depth: 0
125+
persist-credentials: false
119126
- name: Set up uv
120-
uses: astral-sh/setup-uv@v6
127+
uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb
121128
with:
122129
enable-cache: true
123130

@@ -126,10 +133,10 @@ jobs:
126133

127134
- name: Publish to PyPI
128135
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
129-
uses: pypa/gh-action-pypi-publish@release/v1
130-
- name: Create a Release
136+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc
137+
- name: Create a GitHub Release
131138
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
132-
uses: softprops/action-gh-release@v2
139+
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631
133140
with:
134141
files: |
135142
dist/*

.github/workflows/documentation-links.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Read the Docs Pull Request Preview
22
on:
3-
pull_request_target:
3+
pull_request_target: # zizmor: ignore[dangerous-triggers]
44
types:
55
- opened
66

@@ -11,6 +11,6 @@ jobs:
1111
documentation-links:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: readthedocs/actions/preview@v1
14+
- uses: readthedocs/actions/preview@b8bba1484329bda1a3abe986df7ebc80a8950333
1515
with:
1616
project-slug: "python-jsonschema"

.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: Run zizmor
12+
runs-on: ubuntu-latest
13+
permissions:
14+
security-events: write
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
persist-credentials: false
21+
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb
24+
25+
- name: Run zizmor 🌈
26+
run: uvx zizmor --format=sarif .github > results.sarif
27+
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)