Skip to content

Commit dbe3e9e

Browse files
authored
ci: use zizmor and remediate findings (#2223)
1 parent 0fef089 commit dbe3e9e

2 files changed

Lines changed: 44 additions & 4 deletions

File tree

.github/workflows/test.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,28 @@ on:
88
branches:
99
- main
1010

11+
permissions: {}
12+
1113
jobs:
1214
test:
1315
runs-on: ubuntu-latest
1416

1517
steps:
16-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
19+
with:
20+
persist-credentials: false
1721
- name: Setup NodeJS
18-
uses: actions/setup-node@v4
22+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
1923
with:
2024
node-version: 22
2125
- name: Setup Hugo
22-
uses: peaceiris/actions-hugo@v3
26+
uses: peaceiris/actions-hugo@2752ce1d29631191ea3f27c23495fa06139a5b78 # v3.2.1
2327
with:
2428
# same as netlify.toml
2529
hugo-version: '0.148.2'
2630
extended: true
2731
- name: Set up Python 3.13
28-
uses: actions/setup-python@v5
32+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
2933
with:
3034
python-version: 3.13
3135
- name: Setup html5validator

.github/workflows/zizmor.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Lint GitHub Actions
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- release-branch-*
8+
pull_request:
9+
branches:
10+
- '**'
11+
workflow_dispatch:
12+
13+
permissions: {}
14+
15+
jobs:
16+
zizmor:
17+
runs-on: ubuntu-24.04
18+
19+
env:
20+
ZIZMOR_IMAGE: ghcr.io/zizmorcore/zizmor:1.25.2@sha256:14ea7f5cc7c67933394a35b5a38a277397818d232602635edb2010b313afb110
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
25+
with:
26+
persist-credentials: false
27+
28+
- name: Run zizmor
29+
env:
30+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
run: |
32+
docker run \
33+
--volume "${GITHUB_WORKSPACE}:/src:ro" \
34+
--workdir "/src" \
35+
--env "GH_TOKEN" \
36+
"$ZIZMOR_IMAGE" -- /src

0 commit comments

Comments
 (0)