Skip to content

Commit 6199e9e

Browse files
authored
improve GitHubworkflows by introducing zizmor for monitoring (#2686)
* fix(workflows): fetch-depth is for actions/checkout * chore(workflows): update - pin all actions to precise commits - avoid credential leakage from actions/checkout - group action updates going forward - add zimor config to ignore "secrets outside env" - add job to keep validating workflows
1 parent 1519009 commit 6199e9e

3 files changed

Lines changed: 42 additions & 11 deletions

File tree

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,9 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "weekly"
7+
cooldown:
8+
default-days: 7
9+
groups:
10+
action-deps:
11+
patterns:
12+
- "*"

.github/workflows/main.yml

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ jobs:
1515
prettier:
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v6
19-
- uses: actions/setup-node@v6
18+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2019
with:
2120
fetch-depth: 2
21+
persist-credentials: false
22+
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
23+
with:
2224
node-version: "lts/*"
2325
cache: "npm"
2426
- name: Install dependencies
@@ -34,10 +36,12 @@ jobs:
3436
lint:
3537
runs-on: ubuntu-latest
3638
steps:
37-
- uses: actions/checkout@v6
38-
- uses: actions/setup-node@v6
39+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
3940
with:
4041
fetch-depth: 2
42+
persist-credentials: false
43+
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
44+
with:
4145
node-version: "lts/*"
4246
cache: "npm"
4347
- name: Install dependencies
@@ -52,10 +56,12 @@ jobs:
5256
browser-test:
5357
runs-on: ubuntu-22.04
5458
steps:
55-
- uses: actions/checkout@v6
56-
- uses: actions/setup-node@v6
59+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
5760
with:
5861
fetch-depth: 2
62+
persist-credentials: false
63+
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
64+
with:
5965
node-version: "lts/*"
6066
cache: "npm"
6167
- name: Install dependencies
@@ -82,10 +88,12 @@ jobs:
8288
if: ${{ github.ref == 'refs/heads/main' }}
8389
runs-on: ubuntu-latest
8490
steps:
85-
- uses: actions/checkout@v6
86-
- uses: actions/setup-node@v6
91+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
8792
with:
8893
fetch-depth: 2
94+
persist-credentials: false
95+
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
96+
with:
8997
node-version: "lts/*"
9098
cache: "npm"
9199
- name: Install dependencies
@@ -109,11 +117,13 @@ jobs:
109117
node-version: [20, 22, 24]
110118

111119
steps:
112-
- uses: actions/checkout@v6
113-
- name: Use Node.js ${{ matrix.node-version }}
114-
uses: actions/setup-node@v6
120+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
115121
with:
116122
fetch-depth: 2
123+
persist-credentials: false
124+
- name: Use Node.js ${{ matrix.node-version }}
125+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
126+
with:
117127
node-version: ${{ matrix.node-version }}
118128
cache: "npm"
119129
- name: Install dependencies
@@ -123,3 +133,15 @@ jobs:
123133
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1
124134
- name: npm test
125135
run: npm run test-node
136+
137+
validate-workflows:
138+
permissions:
139+
security-events: write
140+
contents: read
141+
actions: read
142+
runs-on: ubuntu-latest
143+
steps:
144+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
145+
with:
146+
persist-credentials: false
147+
- uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2

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