Skip to content

Commit 20101a8

Browse files
committed
add zizmor for linting workflows.
Signed-off-by: NicholasTanz <[email protected]>
1 parent 04d4837 commit 20101a8

9 files changed

+35
-6
lines changed

.github/workflows/_test.yml

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ jobs:
4343
steps:
4444
- name: Checkout securesystemslib
4545
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
46+
with:
47+
persist-credentials: false
4648

4749
- name: Set up Python ${{ matrix.python-version }}
4850
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38

.github/workflows/cd.yml

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

2627
- name: Set up Python
@@ -67,8 +68,8 @@ jobs:
6768
res = await github.rest.repos.createRelease({
6869
owner: context.repo.owner,
6970
repo: context.repo.repo,
70-
name: '${{ github.ref_name }}-rc',
71-
tag_name: '${{ github.ref }}',
71+
name: process.env.REF_NAME + '-rc',
72+
tag_name: process.env.REF,
7273
body: 'Release waiting for review...',
7374
});
7475
@@ -82,6 +83,10 @@ jobs:
8283
});
8384
});
8485
return res.data.id
86+
env:
87+
REF_NAME: ${{ github.ref_name }}
88+
REF: ${{ github.ref }}
89+
8590

8691
release:
8792
name: Release
@@ -106,13 +111,15 @@ jobs:
106111
- name: Finalize GitHub release
107112
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
108113
with:
109-
script: |
114+
script: | # zizmor: ignore[template-injection]
110115
github.rest.repos.updateRelease({
111116
owner: context.repo.owner,
112117
repo: context.repo.repo,
113118
release_id: '${{ needs.candidate_release.outputs.release_id }}',
114-
name: '${{ github.ref_name }}',
119+
name: process.env.REF_NAME,
115120
body: 'See [CHANGELOG.md](https://github.com/' +
116121
context.repo.owner + '/' + context.repo.repo +
117-
'/blob/${{ github.ref_name }}/CHANGELOG.md) for details.'
122+
'/blob/' + process.env.REF_NAME + '/CHANGELOG.md) for details.'
118123
})
124+
env:
125+
REF_NAME: ${{ github.ref_name }}

.github/workflows/check-upstream-ed25519.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
steps:
1818
- name: Check out repository
1919
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
20+
with:
21+
persist-credentials: false
2022
- name: Test if ed25519 upstream main HEAD is what we expect
2123
id: test_ed25519
2224
run: |
@@ -30,7 +32,7 @@ jobs:
3032
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
3133
if: ${{ steps.test_ed25519.outputs.result == '1' }}
3234
with:
33-
script: |
35+
script: | # zizmor: ignore[template-injection]
3436
console.log("ed25519 upstream main has changed!")
3537
console.log("${{ steps.test_ed25519.outputs.output }}")
3638
const repo = context.repo.owner + "/" + context.repo.repo

.github/workflows/test-kms-aws.yml

+6
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,18 @@ on:
44
push:
55
pull_request:
66

7+
permissions: {}
8+
79
jobs:
810
local-aws-kms:
911
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
1014
steps:
1115
- name: Checkout securesystemslib
1216
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
17+
with:
18+
persist-credentials: false
1319

1420
- name: Set up Python
1521
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38

.github/workflows/test-kms.yml

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
steps:
1919
- name: Checkout securesystemslib
2020
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
21+
with:
22+
persist-credentials: false
2123

2224
- name: Set up Python
2325
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38

.github/workflows/test-sigstore.yml

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
steps:
1717
- name: Checkout securesystemslib
1818
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
19+
with:
20+
persist-credentials: false
1921

2022
- name: Set up Python
2123
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38

.github/workflows/test-vault.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,18 @@ on:
44
push:
55
pull_request:
66

7+
permissions: {}
8+
79
jobs:
810
local-vault:
911
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
1014
steps:
1115
- name: Checkout securesystemslib
1216
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
17+
with:
18+
persist-credentials: false
1319

1420
- name: Set up Python
1521
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38

requirements-lint.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
mypy==1.15.0
22
ruff==0.9.7
3+
zizmor==1.4.1

tox.ini

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ commands =
7070
ruff check {[testenv:lint]lint_dirs}
7171

7272
mypy {[testenv:lint]lint_dirs}
73+
zizmor --persona=pedantic -q .
7374

7475
[testenv:fix]
7576
deps = {[testenv:lint]deps}

0 commit comments

Comments
 (0)