Skip to content

Commit 69351cf

Browse files
serhalpdanielroe
andauthored
ci: configure zizmor GHA security checks, fix findings (#2632)
Co-authored-by: Daniel Roe <daniel@roe.dev>
1 parent 4760dca commit 69351cf

18 files changed

Lines changed: 189 additions & 38 deletions

.github/workflows/autofix.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
branches:
1010
- main
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
14+
cancel-in-progress: true
15+
1216
permissions:
1317
contents: read
1418

@@ -19,8 +23,10 @@ jobs:
1923

2024
steps:
2125
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26+
with:
27+
persist-credentials: false
2228

23-
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1
29+
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1.6.0
2430
with:
2531
node-version: lts/*
2632
cache: true
@@ -37,4 +43,4 @@ jobs:
3743
- name: 🔠 Fix lint errors
3844
run: vp run lint:fix
3945

40-
- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27 # 635ffb0c9798bd160680f18fd73371e355b85f27
46+
- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27 # v1.3.2

.github/workflows/chromatic.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ jobs:
2525
fetch-depth: 0
2626
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
2727
ref: ${{ github.event.pull_request.head.sha || github.sha }}
28+
persist-credentials: false
2829

29-
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1
30+
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1.6.0
3031
with:
3132
node-version: lts/*
3233
cache: true

.github/workflows/ci.yml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ jobs:
2727

2828
steps:
2929
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
30+
with:
31+
persist-credentials: false
3032

31-
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1
33+
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1.6.0
3234
with:
3335
node-version: lts/*
3436
run-install: false
@@ -45,8 +47,10 @@ jobs:
4547

4648
steps:
4749
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
50+
with:
51+
persist-credentials: false
4852

49-
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1
53+
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1.6.0
5054
with:
5155
node-version: lts/*
5256
cache: true
@@ -60,8 +64,10 @@ jobs:
6064

6165
steps:
6266
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
67+
with:
68+
persist-credentials: false
6369

64-
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1
70+
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1.6.0
6571
with:
6672
node-version: lts/*
6773
cache: true
@@ -81,8 +87,10 @@ jobs:
8187

8288
steps:
8389
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
90+
with:
91+
persist-credentials: false
8492

85-
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1
93+
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1.6.0
8694
with:
8795
node-version: lts/*
8896
cache: true
@@ -109,15 +117,17 @@ jobs:
109117
name: 🖥️ Browser tests
110118
runs-on: ubuntu-24.04-arm
111119
container:
112-
image: mcr.microsoft.com/playwright:v1.58.2-noble
120+
image: mcr.microsoft.com/playwright:v1.58.2-noble@sha256:6446946a1d9fd62d9ae501312a2d76a43ee688542b21622056a372959b65d63d
113121

114122
steps:
115123
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
124+
with:
125+
persist-credentials: false
116126

117127
- name: 👑 Fix Git ownership
118128
run: git config --global --add safe.directory /__w/npmx.dev/npmx.dev
119129

120-
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1
130+
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1.6.0
121131
with:
122132
node-version: lts/*
123133
cache: true
@@ -139,8 +149,10 @@ jobs:
139149

140150
steps:
141151
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
152+
with:
153+
persist-credentials: false
142154

143-
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1
155+
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1.6.0
144156
with:
145157
node-version: lts/*
146158
cache: true
@@ -160,8 +172,10 @@ jobs:
160172

161173
steps:
162174
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
175+
with:
176+
persist-credentials: false
163177

164-
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1
178+
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1.6.0
165179
with:
166180
node-version: lts/*
167181
cache: true
@@ -175,8 +189,10 @@ jobs:
175189

176190
steps:
177191
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
192+
with:
193+
persist-credentials: false
178194

179-
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1
195+
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1.6.0
180196
with:
181197
node-version: lts/*
182198
run-install: false

.github/workflows/dependency-diff-comment.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,20 @@ on:
66
types:
77
- completed
88

9-
permissions:
10-
pull-requests: write
11-
actions: read
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.workflow_run.id }}
11+
cancel-in-progress: true
12+
13+
permissions: {}
1214

1315
jobs:
1416
dependency-diff-comment:
1517
name: 💬 Dependency diff comment
1618
runs-on: ubuntu-slim
1719
if: github.event.workflow_run.conclusion == 'success'
20+
permissions:
21+
pull-requests: write # post dependency diff comments on pull requests
22+
actions: read # download artifacts from dependency-diff runs
1823

1924
steps:
2025
- name: 📥 Download artifact

.github/workflows/dependency-diff.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2929
with:
3030
fetch-depth: 0
31+
persist-credentials: false
3132

3233
- name: 🔎 Compare dependencies
3334
id: analyze

.github/workflows/deploy-canary.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ jobs:
1818
runs-on: ubuntu-24.04-arm
1919
steps:
2020
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
21+
with:
22+
persist-credentials: false
2123

22-
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1
24+
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1.6.0
2325
with:
2426
node-version: lts/*
2527
run-install: false

.github/workflows/lunaria.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ concurrency:
1010
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}
1111
cancel-in-progress: true
1212

13-
# Allow this job to clone the repository and comment on the pull request
14-
permissions:
15-
contents: read
16-
pull-requests: write
13+
permissions: {}
1714

1815
jobs:
1916
lunaria-overview:
2017
name: 🌝 Generate Lunaria Overview
2118
runs-on: ubuntu-24.04-arm
19+
permissions:
20+
contents: read
21+
pull-requests: write # post Lunaria overview comments on pull requests
2222

2323
steps:
2424
- name: Checkout
@@ -27,11 +27,12 @@ jobs:
2727
# Necessary for Lunaria to work properly
2828
# Makes the action clone the entire git history
2929
fetch-depth: 0
30+
persist-credentials: false
3031

31-
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1
32+
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1.6.0
3233
with:
3334
node-version: lts/*
3435
cache: true
3536

3637
- name: Generate Lunaria Overview
37-
uses: lunariajs/action@4911ad0736d1e3b20af4cb70f5079aea2327ed8e # v1-prerelease
38+
uses: lunariajs/action@4911ad0736d1e3b20af4cb70f5079aea2327ed8e # astro-docs

.github/workflows/mirror-tangled.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
tags:
88
- '*'
99

10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
1014
permissions:
1115
contents: read
1216

@@ -20,6 +24,7 @@ jobs:
2024
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2125
with:
2226
fetch-depth: 0
27+
persist-credentials: false
2328

2429
- name: 🔑 Configure SSH
2530
env:

.github/workflows/release-pr.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,28 @@ on:
55
branches:
66
- main
77

8-
permissions:
9-
contents: read
10-
pull-requests: write
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
permissions: {}
1113

1214
jobs:
1315
release-pr:
1416
name: 🚀 Create or update release PR
1517
runs-on: ubuntu-slim
1618
if: github.repository == 'npmx-dev/npmx.dev'
19+
permissions:
20+
contents: read
21+
pull-requests: write # create or update the release pull request
1722

1823
steps:
1924
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2025
with:
2126
fetch-depth: 0
27+
persist-credentials: false
2228

23-
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1
29+
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1.6.0
2430
with:
2531
node-version: lts/*
2632
run-install: false

.github/workflows/release-tag.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches:
66
- release
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
812
permissions: {}
913

1014
jobs:
@@ -13,7 +17,7 @@ jobs:
1317
runs-on: ubuntu-slim
1418
if: github.repository == 'npmx-dev/npmx.dev'
1519
permissions:
16-
contents: write
20+
contents: write # create release tags and GitHub releases
1721
outputs:
1822
version: ${{ steps.version.outputs.next }}
1923
skipped: ${{ steps.check.outputs.skip }}
@@ -22,8 +26,9 @@ jobs:
2226
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2327
with:
2428
fetch-depth: 0
29+
persist-credentials: true
2530

26-
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1
31+
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1.6.0
2732
with:
2833
node-version: lts/*
2934
run-install: false
@@ -87,15 +92,16 @@ jobs:
8792
if: needs.tag.outputs.skipped == 'false'
8893
permissions:
8994
contents: read
90-
id-token: write
95+
id-token: write # authenticate npm trusted publishing via OIDC
9196
environment: npm-publish
9297

9398
steps:
9499
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
95100
with:
96101
ref: release
102+
persist-credentials: false
97103

98-
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1
104+
- uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1.6.0
99105
with:
100106
node-version: lts/*
101107
registry-url: https://registry.npmjs.org

0 commit comments

Comments
 (0)