Skip to content

Commit 39388c3

Browse files
authored
Merge pull request #2798 from NicholasTanz/addZizmor
add zizmor for linting workflows.
2 parents 54789bc + a6fc606 commit 39388c3

11 files changed

+37
-10
lines changed

.github/workflows/_test.yml

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
steps:
1313
- name: Checkout TUF
1414
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
15+
with:
16+
persist-credentials: false
1517

1618
- name: Set up Python (oldest supported version)
1719
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
@@ -49,6 +51,8 @@ jobs:
4951
steps:
5052
- name: Checkout TUF
5153
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
54+
with:
55+
persist-credentials: false
5256

5357
- name: Set up Python ${{ matrix.python-version }}
5458
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0

.github/workflows/_test_sslib_main.yml

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
steps:
1313
- name: Checkout TUF
1414
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
15+
with:
16+
persist-credentials: false
1517

1618
- name: Set up Python
1719
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0

.github/workflows/cd.yml

+12-4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
- name: Checkout release tag
2121
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2222
with:
23+
persist-credentials: false
2324
ref: ${{ github.event.workflow_run.head_branch }}
2425

2526
- name: Set up Python
@@ -66,8 +67,8 @@ jobs:
6667
res = await github.rest.repos.createRelease({
6768
owner: context.repo.owner,
6869
repo: context.repo.repo,
69-
name: '${{ github.ref_name }}-rc',
70-
tag_name: '${{ github.ref }}',
70+
name: process.env.REF_NAME + '-rc',
71+
tag_name: process.env.REF,
7172
body: fs.readFileSync('changelog', 'utf8'),
7273
});
7374
@@ -81,6 +82,9 @@ jobs:
8182
});
8283
});
8384
return res.data.id
85+
env:
86+
REF_NAME: ${{ github.ref_name }}
87+
REF: ${{ github.ref }}
8488

8589
release:
8690
name: Release
@@ -108,6 +112,10 @@ jobs:
108112
github.rest.repos.updateRelease({
109113
owner: context.repo.owner,
110114
repo: context.repo.repo,
111-
release_id: '${{ needs.candidate_release.outputs.release_id }}',
112-
name: '${{ github.ref_name }}',
115+
release_id: process.env.RELEASE_ID,
116+
name: process.env.REF_NAME,
113117
})
118+
119+
env:
120+
REF_NAME: ${{ github.ref_name }}
121+
RELEASE_ID: ${{ needs.candidate_release.outputs.release_id }}

.github/workflows/codeql-analysis.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ jobs:
2424
steps:
2525
- name: Checkout repository
2626
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
27+
with:
28+
persist-credentials: false
2729

2830
- name: Initialize CodeQL
29-
uses: github/codeql-action/init@v3 # unpinned since this is not security critical
31+
uses: github/codeql-action/init@v3 # zizmor: ignore[unpinned-uses]
3032
with:
3133
languages: 'python'
3234

3335
- name: Perform CodeQL Analysis
34-
uses: github/codeql-action/analyze@v3 # unpinned since this is not security critical
36+
uses: github/codeql-action/analyze@v3 # zizmor: ignore[unpinned-uses]

.github/workflows/conformance.yml

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
steps:
1616
- name: Checkout conformance client
1717
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
with:
19+
persist-credentials: false
1820

1921
- name: Run test suite
2022
uses: theupdateframework/tuf-conformance@9bfc222a371e30ad5511eb17449f68f855fb9d8f # v2.3.0

.github/workflows/dependency-review.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ jobs:
1717
steps:
1818
- name: 'Checkout Repository'
1919
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
with:
21+
persist-credentials: false
2022
- name: 'Dependency Review'
21-
uses: actions/dependency-review-action@v4 # unpinned since this is not security critical
23+
uses: actions/dependency-review-action@v4 # zizmor: ignore[unpinned-uses]

.github/workflows/maintainer-permissions-reminder.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ on:
55
- cron: '10 10 10 2 *'
66
workflow_dispatch:
77

8-
permissions:
9-
issues: write
8+
permissions: {}
109

1110
jobs:
1211
file-reminder-issue:
1312
name: File issue to review maintainer permissions
1413
runs-on: ubuntu-latest
14+
permissions:
15+
issues: write
1516
steps:
1617
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
1718
with:

.github/workflows/scorecards.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
steps:
2424
- name: "Checkout code"
2525
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+
with:
27+
persist-credentials: false
2628

2729
- name: "Run analysis"
2830
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
@@ -35,6 +37,6 @@ jobs:
3537
publish_results: true
3638

3739
- name: "Upload to code-scanning dashboard"
38-
uses: github/codeql-action/upload-sarif@v3 # unpinned since this is not security critical
40+
uses: github/codeql-action/upload-sarif@v3 # zizmor: ignore[unpinned-uses]
3941
with:
4042
sarif_file: results.sarif

.github/workflows/specification-version-check.yml

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
version: ${{ steps.get-version.outputs.version }}
1616
steps:
1717
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
with:
19+
persist-credentials: false
1820
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
1921
with:
2022
python-version: "3.x"

requirements/lint.txt

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# are pinned to prevent unexpected linting failures when tools update)
99
ruff==0.9.6
1010
mypy==1.15.0
11+
zizmor==1.3.1
1112

1213
# Required for type stubs
1314
freezegun==1.5.1

tox.ini

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ commands =
4242
ruff format --diff {[testenv:lint]lint_dirs}
4343

4444
mypy {[testenv:lint]lint_dirs}
45+
zizmor --persona=pedantic -q .
4546

4647
[testenv:fix]
4748
deps = {[testenv:lint]deps}

0 commit comments

Comments
 (0)