Skip to content

Commit 986e9eb

Browse files
reberhardt7claude
andauthored
fix: harden GitHub Actions workflows (zizmor) (#12)
- Upgrade actions/checkout to v6.0.2 and add persist-credentials: false - Add workflow-level permissions: {} to release.yml and contents: read to test.yml - Replace secrets: inherit with explicit secret passing (SOCKET_API_KEY) - Disable caching in release workflow setup-bun to prevent cache poisoning - Declare SOCKET_API_KEY as optional workflow_call secret in test.yml - Disable secrets-outside-env rule via .github/zizmor.yml Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1bac8d8 commit 986e9eb

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ on:
55
tags:
66
- "v*.*.*"
77

8+
permissions: {}
9+
810
jobs:
911
test:
1012
uses: ./.github/workflows/test.yml
11-
secrets: inherit
13+
secrets:
14+
SOCKET_API_KEY: ${{ secrets.SOCKET_API_KEY }}
1215

1316
release:
1417
runs-on: ubuntu-latest
@@ -21,10 +24,14 @@ jobs:
2124

2225
steps:
2326
- name: Checkout code
24-
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
27+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
28+
with:
29+
persist-credentials: false
2530

2631
- name: Setup Bun
2732
uses: oven-sh/setup-bun@22457c87c1b161cf7dde222c3e82b2b5f8d2bed2
33+
with:
34+
no-cache: true
2835

2936
- name: Update npm to latest just to get --provenance
3037
run: bun install -g npm@latest

.github/workflows/test.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ on:
77
pull_request:
88
branches: [main]
99
workflow_call:
10+
secrets:
11+
SOCKET_API_KEY:
12+
required: false
13+
14+
permissions:
15+
contents: read
1016

1117
jobs:
1218
test:
@@ -17,7 +23,9 @@ jobs:
1723

1824
steps:
1925
- name: Checkout code
20-
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
26+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
27+
with:
28+
persist-credentials: false
2129

2230
- name: Setup Bun
2331
uses: oven-sh/setup-bun@22457c87c1b161cf7dde222c3e82b2b5f8d2bed2

.github/zizmor.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
rules:
2+
secrets-outside-env:
3+
disable: true

0 commit comments

Comments
 (0)