Skip to content

Commit c33f7ac

Browse files
committed
ci: satisfy zizmor — pin actions and scope permissions
Pins all four action references to commit SHAs, keeping the version as a trailing comment so the intent stays readable and Dependabot can still update them. This was the reported failure: unpinned-uses is a mandatory check under a blanket pin-to-hash policy. Fixing only that would have left CI red, because the gate also fails on any Medium finding and three more were present, all pre-existing: - artipacked: actions/checkout persists the GITHUB_TOKEN into .git/config, which is reachable from build output and uploaded artifacts. The build job never pushes and the deploy job supplies its own token, so persist-credentials: false costs nothing. - excessive-permissions (x2): the workflow declared no permissions, so both jobs ran with broad defaults. Deny at the top level and opt in per job -- contents: read for build, and deploy keeps the contents: write it already had. Verified with zizmor 1.29.0 locally: 'No findings to report', exit 0, where the same run previously reported four errors plus three warnings. The build pipeline is unaffected -- tests pass and the staged artifact is still byte-identical. Note actions/checkout is pinned at v2, which is old enough to be worth bumping on its own merits; left alone here to keep this change to the security fix.
1 parent e9d5b28 commit c33f7ac

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

.github/workflows/actions.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,25 @@ on:
55
branches: [main]
66
pull_request:
77

8+
# Deny by default; each job opts in to what it needs.
9+
permissions: {}
10+
811
jobs:
912
build:
13+
permissions:
14+
contents: read
1015
runs-on: ubuntu-latest
1116
steps:
12-
- uses: actions/checkout@v2
17+
# persist-credentials: false keeps the token out of .git/config, which is
18+
# otherwise reachable from build output and uploaded artifacts. Nothing here
19+
# pushes; the deploy job supplies its own token.
20+
- uses: actions/checkout@0717577d45739eb3c851188b29f50ed6c0b2194e # v2
21+
with:
22+
persist-credentials: false
1323
# Bazel provides the Node toolchain, npm dependencies and browsers, so no
1424
# setup-node, package-manager install or playwright install step is needed.
1525
# All four caches default to false and must be enabled explicitly.
16-
- uses: bazel-contrib/setup-bazel@0.19.0
26+
- uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0
1727
with:
1828
bazelisk-cache: true
1929
disk-cache: ${{ github.workflow }}
@@ -27,7 +37,7 @@ jobs:
2737
# convenience symlink.
2838
- name: Stage site
2939
run: bazel run //:stage_site
30-
- uses: actions/upload-artifact@v4
40+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
3141
with:
3242
name: out
3343
path: out/
@@ -39,7 +49,7 @@ jobs:
3949
contents: write
4050
runs-on: ubuntu-latest
4151
steps:
42-
- uses: actions/download-artifact@v4.1.7
52+
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
4353
with:
4454
name: out
4555
path: out/

0 commit comments

Comments
 (0)