Skip to content

Commit 02b4970

Browse files
authored
ci: use zizmor and remediate findings (#346)
1 parent 9c5a4e8 commit 02b4970

3 files changed

Lines changed: 50 additions & 6 deletions

File tree

.github/workflows/lint.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@ on:
77
pull_request:
88
branches:
99
- '**'
10+
11+
permissions: {}
12+
1013
jobs:
1114
lint:
12-
1315
runs-on: ubuntu-latest
1416
steps:
15-
- uses: actions/checkout@v4
16-
- uses: actions/setup-go@v5
17+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
18+
with:
19+
persist-credentials: false
20+
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
1721
- name: Run linter
1822
working-directory: ./tools/lint
1923
run: go run . ../../CP-CPS.md

.github/workflows/pr_tools.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,22 @@ on:
77
pull_request:
88
branches:
99
- '**'
10+
11+
permissions: {}
12+
1013
jobs:
1114
build:
12-
1315
runs-on: ubuntu-latest
1416
strategy:
1517
matrix:
1618
python-version: [3.8, 3.12.3]
1719

1820
steps:
19-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
22+
with:
23+
persist-credentials: false
2024
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v5
25+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
2226
with:
2327
python-version: ${{ matrix.python-version }}
2428
- name: Install dependencies

.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)