Skip to content

Commit 0fff862

Browse files
authored
ci: make workflows pass Zizmor in pedantic mode (#798)
* ci: make workflows pass Zizmor in pedantic mode * Allow running CodeQL on demand * Add permission comment * Actually run in pedantic mode
1 parent 0dd8ca5 commit 0fff862

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

.github/workflows/build-docset.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ permissions: {}
1818

1919
jobs:
2020
docset:
21+
name: Build docset
2122
runs-on: ubuntu-latest
2223
steps:
2324
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,20 @@ name: CodeQL
44
on:
55
schedule:
66
- cron: "41 3 * * 6"
7+
workflow_dispatch:
78

89
concurrency:
910
group: ${{ github.workflow }}
1011
cancel-in-progress: true
1112

12-
permissions:
13-
contents: read
13+
permissions: {}
1414

1515
jobs:
1616
analyze:
1717
name: Analyze
1818
runs-on: ubuntu-latest
1919
permissions:
20-
actions: read
21-
contents: read
22-
security-events: write
20+
security-events: write # necessary according to docs
2321

2422
strategy:
2523
fail-fast: false

.github/workflows/pypi-package.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ concurrency:
1414
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1515
cancel-in-progress: true
1616

17+
permissions: {}
18+
1719
jobs:
1820
# Always build & lint package.
1921
build-package:
2022
name: Build & verify package
2123
runs-on: ubuntu-latest
2224
permissions:
23-
attestations: write
24-
id-token: write
25+
attestations: write # necessary for GitHub attestations
26+
id-token: write # necessary for GitHub attestations
2527

2628
steps:
2729
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -42,7 +44,7 @@ jobs:
4244
needs: build-package
4345

4446
permissions:
45-
id-token: write
47+
id-token: write # necessary for trusted publishing
4648

4749
steps:
4850
- name: Download packages built by build-and-inspect-python-package
@@ -65,7 +67,7 @@ jobs:
6567
needs: build-package
6668

6769
permissions:
68-
id-token: write
70+
id-token: write # necessary for trusted publishing
6971

7072
steps:
7173
- name: Download packages built by build-and-inspect-python-package

.github/workflows/zizmor.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ jobs:
2828

2929
- name: Run zizmor 🌈
3030
uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2
31+
with:
32+
persona: pedantic
3133
...

0 commit comments

Comments
 (0)