Skip to content

Commit 5e22cce

Browse files
Add zizmor
Scan GitHub Actions workflows with zizmor and fix/suppress findings.
1 parent dd39e00 commit 5e22cce

File tree

7 files changed

+22
-4
lines changed

7 files changed

+22
-4
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
5757
with:
5858
filter: 'tree:0'
59+
persist-credentials: false
5960
show-progress: false
6061

6162
- name: Setup .NET SDK

.github/workflows/bump-version.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2828
with:
2929
filter: 'tree:0'
30+
persist-credentials: true # zizmor: ignore[artipacked] Needed to push commits
3031
show-progress: false
3132
token: ${{ secrets.COSTELLOBOT_TOKEN }}
3233

.github/workflows/codeql.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3434
with:
3535
filter: 'tree:0'
36+
persist-credentials: false
3637
show-progress: false
3738

3839
- name: Initialize CodeQL

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2121
with:
2222
filter: 'tree:0'
23+
persist-credentials: false
2324
show-progress: false
2425

2526
- name: Review dependencies

.github/workflows/lint.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ on:
1414
- dotnet-nightly
1515
workflow_dispatch:
1616

17-
permissions:
18-
contents: read
17+
permissions: {}
1918

2019
env:
2120
FORCE_COLOR: 3
@@ -24,27 +23,41 @@ env:
2423
# renovate: datasource=github-releases depName=PSScriptAnalyzer packageName=PowerShell/PSScriptAnalyzer
2524
PSSCRIPTANALYZER_VERSION: '1.24.0'
2625
TERM: xterm
26+
# renovate: datasource=github-releases depName=zizmor packageName=zizmorcore/zizmor
27+
ZIZMOR_VERSION: '1.12.0'
2728

2829
jobs:
2930
lint:
3031
runs-on: ubuntu-latest
3132

33+
permissions:
34+
actions: read
35+
contents: read
36+
security-events: write
37+
3238
steps:
3339

3440
- name: Checkout code
3541
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3642
with:
3743
filter: 'tree:0'
44+
persist-credentials: false
3845
show-progress: false
3946

4047
- name: Add actionlint problem matcher
4148
run: echo "::add-matcher::.github/actionlint-matcher.json"
4249

43-
- name: Lint workflows
50+
- name: Lint workflows with actionlint
4451
uses: docker://rhysd/actionlint:1.7.7@sha256:887a259a5a534f3c4f36cb02dca341673c6089431057242cdc931e9f133147e9
4552
with:
4653
args: -color
4754

55+
- name: Lint workflows with zizmor
56+
uses: zizmorcore/zizmor-action@5ca5fc7a4779c5263a3ffa0e1f693009994446d1 # v0.1.2
57+
with:
58+
persona: pedantic
59+
version: ${{ env.ZIZMOR_VERSION }}
60+
4861
- name: Lint markdown
4962
uses: DavidAnson/markdownlint-cli2-action@992badcdf24e3b8eb7e87ff9287fe931bcb00c6e # v20.0.0
5063
with:

.github/workflows/ossf-scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- cron: '0 5 * * MON'
99
workflow_dispatch:
1010

11-
permissions: read-all
11+
permissions: read-all # zizmor: ignore[excessive-permissions] Recommended permissions for OSSF Scorecard
1212

1313
jobs:
1414
analysis:

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2626
with:
2727
filter: 'tree:0'
28+
persist-credentials: true # zizmor: ignore[artipacked] Needed to push commits
2829
show-progress: false
2930
token: ${{ secrets.COSTELLOBOT_TOKEN }}
3031

0 commit comments

Comments
 (0)