Skip to content

Commit 2452be0

Browse files
Add zizmor
Scan GitHub Actions workflows with zizmor and fix/suppress findings.
1 parent ca0f188 commit 2452be0

File tree

4 files changed

+43
-15
lines changed

4 files changed

+43
-15
lines changed

.github/workflows/benchmark.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,21 @@ jobs:
3232
steps:
3333

3434
- name: Checkout code
35-
uses: actions/checkout@v5
35+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
36+
with:
37+
filter: 'tree:0'
38+
persist-credentials: false
39+
show-progress: false
3640

3741
- name: Setup .NET SDK
38-
uses: actions/setup-dotnet@v4
42+
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
3943

4044
- name: Run benchmarks
4145
shell: pwsh
4246
run: ./benchmark.ps1
4347

4448
- name: Publish BenchmarkDotNet artifacts
45-
uses: actions/upload-artifact@v4
49+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
4650
if: ${{ !cancelled() }}
4751
with:
4852
name: artifacts
@@ -57,7 +61,7 @@ jobs:
5761
"repo-name=${repoName}" >> ${env:GITHUB_OUTPUT}
5862
5963
- name: Publish results
60-
uses: martincostello/benchmarkdotnet-results-publisher@v1
64+
uses: martincostello/benchmarkdotnet-results-publisher@abcb3ce3975e1e86f06f2c04e3a4059ccdb91cc1 # v1.0.2
6165
with:
6266
branch: ${{ github.ref_name }}
6367
comment-on-threshold: true

.github/workflows/build.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ env:
2222
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: 1
2323
FORCE_COLOR: 3
2424
NUGET_XMLDOC_MODE: skip
25+
# renovate: datasource=npm depName=spectral-cli packageName=@stoplight/spectral-cli
26+
SPECTRAL_CLI_VERSION: '6.15.0'
2527
TERM: xterm
2628

2729
jobs:
@@ -40,13 +42,17 @@ jobs:
4042
steps:
4143

4244
- name: Checkout code
43-
uses: actions/checkout@v5
45+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
46+
with:
47+
filter: 'tree:0'
48+
persist-credentials: false
49+
show-progress: false
4450

4551
- name: Setup .NET SDK
46-
uses: actions/setup-dotnet@v4
52+
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
4753

4854
- name: Setup Node
49-
uses: actions/setup-node@v4
55+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
5056
with:
5157
node-version: '22'
5258

@@ -55,7 +61,7 @@ jobs:
5561
run: ./build.ps1
5662

5763
- name: Install Spectral
58-
run: npm install -g @stoplight/spectral-cli
64+
run: npm install -g "@stoplight/spectral-cli@${SPECTRAL_CLI_VERSION}"
5965

6066
- name: Run Spectral
6167
run: spectral lint "./artifacts/openapi/*" --fail-severity warn --format github-actions

.github/workflows/codeql.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,21 @@ jobs:
2929

3030
steps:
3131
- name: Checkout repository
32-
uses: actions/checkout@v5
32+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
33+
with:
34+
filter: 'tree:0'
35+
persist-credentials: false
36+
show-progress: false
3337

3438
- name: Initialize CodeQL
35-
uses: github/codeql-action/init@v3
39+
uses: github/codeql-action/init@df559355d593797519d70b90fc8edd5db049e7a2 # v3.29.9
3640
with:
3741
build-mode: none
3842
languages: ${{ matrix.language }}
3943
queries: security-and-quality
4044

4145
- name: Perform CodeQL Analysis
42-
uses: github/codeql-action/analyze@v3
46+
uses: github/codeql-action/analyze@df559355d593797519d70b90fc8edd5db049e7a2 # v3.29.9
4347
with:
4448
category: '/language:${{ matrix.language }}'
4549

.github/workflows/lint.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,43 @@ permissions: {}
1919
env:
2020
FORCE_COLOR: 3
2121
TERM: xterm
22+
# renovate: datasource=github-releases depName=zizmor packageName=zizmorcore/zizmor
23+
ZIZMOR_VERSION: '1.12.1'
2224

2325
jobs:
2426
lint:
2527
runs-on: ubuntu-latest
2628

2729
permissions:
30+
actions: read
2831
contents: read
32+
security-events: write
2933

3034
steps:
3135

3236
- name: Checkout code
33-
uses: actions/checkout@v5
37+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
38+
with:
39+
filter: 'tree:0'
40+
persist-credentials: false
41+
show-progress: false
3442

3543
- name: Add actionlint problem matcher
3644
run: echo "::add-matcher::.github/actionlint-matcher.json"
3745

38-
- name: Lint workflows
39-
uses: docker://rhysd/actionlint:1.7.7
46+
- name: Lint workflows with actionlint
47+
uses: docker://rhysd/actionlint:1.7.7@sha256:887a259a5a534f3c4f36cb02dca341673c6089431057242cdc931e9f133147e9
4048
with:
4149
args: -color
4250

51+
- name: Lint workflows with zizmor
52+
uses: zizmorcore/zizmor-action@5ca5fc7a4779c5263a3ffa0e1f693009994446d1 # v0.1.2
53+
with:
54+
persona: pedantic
55+
version: ${{ env.ZIZMOR_VERSION }}
56+
4357
- name: Lint markdown
44-
uses: DavidAnson/markdownlint-cli2-action@v20
58+
uses: DavidAnson/markdownlint-cli2-action@992badcdf24e3b8eb7e87ff9287fe931bcb00c6e # v20.0.0
4559
with:
4660
config: '.markdownlint.json'
4761
globs: |

0 commit comments

Comments
 (0)