Skip to content

Commit fd3cd5a

Browse files
authored
Set up zizmor for github actions linting (#221)
Signed-off-by: Samuel Giddins <[email protected]>
1 parent c8ad4cf commit fd3cd5a

File tree

4 files changed

+50
-6
lines changed

4 files changed

+50
-6
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ jobs:
3838
egress-policy: audit
3939

4040
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
41+
with:
42+
persist-credentials: false
4143
- name: Set up Ruby
4244
uses: ruby/setup-ruby@f2f42b7848feff522ffa488a5236ba0a73bccbdd # v1.219.0
4345
with:
@@ -75,6 +77,8 @@ jobs:
7577
egress-policy: audit
7678

7779
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
80+
with:
81+
persist-credentials: false
7882
- name: Set up Ruby
7983
uses: ruby/setup-ruby@f2f42b7848feff522ffa488a5236ba0a73bccbdd # v1.219.0
8084
with:
@@ -122,6 +126,8 @@ jobs:
122126
egress-policy: audit
123127

124128
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
129+
with:
130+
persist-credentials: false
125131
- name: Set up Ruby
126132
uses: ruby/setup-ruby@f2f42b7848feff522ffa488a5236ba0a73bccbdd # v1.219.0
127133
with:
@@ -219,10 +225,41 @@ jobs:
219225
egress-policy: audit
220226

221227
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
228+
with:
229+
persist-credentials: false
222230
- name: Set up Ruby
223231
uses: ruby/setup-ruby@f2f42b7848feff522ffa488a5236ba0a73bccbdd # v1.219.0
224232
with:
225233
ruby-version: ${{ fromJson(needs.ruby-versions.outputs.latest) }}
226234
bundler-cache: true
227235
- name: Run the linter
228236
run: bin/rubocop
237+
238+
zizmor:
239+
name: zizmor
240+
runs-on: ubuntu-latest
241+
permissions:
242+
security-events: write
243+
# required for workflows in private repositories
244+
contents: read
245+
actions: read
246+
steps:
247+
- name: Checkout repository
248+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
249+
with:
250+
persist-credentials: false
251+
252+
- name: Install the latest version of uv
253+
uses: astral-sh/setup-uv@180f8b44399608a850e1db031fa65c77746566d3 # v5.0.1
254+
255+
- name: Run zizmor 🌈
256+
run: uvx zizmor --format sarif . > results.sarif
257+
258+
env:
259+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
260+
261+
- name: Upload SARIF file
262+
uses: github/codeql-action/upload-sarif@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9
263+
with:
264+
sarif_file: results.sarif
265+
category: zizmor

.github/workflows/codeql.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ jobs:
4747

4848
- name: Checkout repository
4949
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
50+
with:
51+
persist-credentials: false
5052

5153
# Initializes the CodeQL tools for scanning.
5254
- name: Initialize CodeQL

.github/workflows/dependency-review.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# PRs introducing known-vulnerable packages will be blocked from merging.
77
#
88
# Source repository: https://github.com/actions/dependency-review-action
9-
name: 'Dependency Review'
9+
name: "Dependency Review"
1010
on: [pull_request]
1111

1212
permissions:
@@ -21,7 +21,9 @@ jobs:
2121
with:
2222
egress-policy: audit
2323

24-
- name: 'Checkout Repository'
24+
- name: "Checkout Repository"
2525
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26-
- name: 'Dependency Review'
26+
with:
27+
persist-credentials: false
28+
- name: "Dependency Review"
2729
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0

.github/workflows/scorecard.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@ on:
1010
# To guarantee Maintained check is occasionally updated. See
1111
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
1212
schedule:
13-
- cron: '37 2 * * 0'
13+
- cron: "37 2 * * 0"
1414
push:
15-
branches: [ "main" ]
15+
branches: ["main"]
1616

1717
# Declare default permissions as read only.
18-
permissions: read-all
18+
permissions:
19+
contents: read
20+
security-events: read
21+
actions: read
1922

2023
jobs:
2124
analysis:

0 commit comments

Comments
 (0)