1313 matrix : ${{ steps.set.outputs.matrix }}
1414 any : ${{ steps.set.outputs.any }}
1515 steps :
16- - uses : actions/checkout@v4
16+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1717 - uses : dorny/paths-filter@d1c1ffe0248fe513906c8e24db8ea791d46f8590 # v3.0.3
1818 id : filter
1919 with :
6161 with-solana:
6262 - 'with-solana/**'
6363 - '.github/workflows/build.yml'
64+ with-angular:
65+ - 'with-angular/**'
66+ - '.github/workflows/build.yml'
67+ with-crossmint:
68+ - 'with-crossmint/**'
69+ - '.github/workflows/build.yml'
70+ with-openfort:
71+ - 'with-openfort/**'
72+ - '.github/workflows/build.yml'
73+ with-turnkey:
74+ - 'with-turnkey/**'
75+ - '.github/workflows/build.yml'
6476
6577 # Build the matrix from a static config, filtered to changed examples.
6678 # The matrix is consumed via `needs` (allowed in jobs.<id>.strategy);
7486 {"name":"with-react","dir":"with-react","pm":"pnpm","build":"build","node":"22"},
7587 {"name":"with-next-app-router","dir":"with-next-app-router","pm":"pnpm","build":"next:build","node":"22"},
7688 {"name":"with-next-page-router","dir":"with-next-page-router","pm":"pnpm","build":"build","node":"22"},
77- {"name":"with-dynamic","dir":"with-dynamic","pm":"pnpm","build":"build","node":"22"},
89+ {"name":"with-dynamic","dir":"with-dynamic","pm":"pnpm","build":"build","node":"22","audit":"critical" },
7890 {"name":"with-farcaster","dir":"with-farcaster","pm":"pnpm","build":"build","node":"22"},
7991 {"name":"with-metamask","dir":"with-metamask","pm":"pnpm","build":"build","node":"22"},
8092 {"name":"with-porto","dir":"with-porto","pm":"pnpm","build":"build","node":"22"},
8395 {"name":"with-reown","dir":"with-reown","pm":"pnpm","build":"build","node":"22"},
8496 {"name":"with-thirdweb","dir":"with-thirdweb","pm":"pnpm","build":"build","node":"22"},
8597 {"name":"with-web3-onboard","dir":"with-web3-onboard","pm":"pnpm","build":"build","node":"22"},
86- {"name":"with-react-native","dir":"with-react-native","pm":"pnpm","build":"typecheck","node":"22"},
87- {"name":"with-solana","dir":"with-solana","pm":"pnpm","build":"build","node":"22"}
98+ {"name":"with-react-native","dir":"with-react-native","pm":"pnpm","build":"typecheck","node":"22","audit":"critical"},
99+ {"name":"with-solana","dir":"with-solana","pm":"pnpm","build":"build","node":"22"},
100+ {"name":"with-angular","dir":"with-angular","pm":"pnpm","build":"build","node":"22"},
101+ {"name":"with-crossmint","dir":"with-crossmint","pm":"pnpm","build":"build","node":"22","audit":"critical"},
102+ {"name":"with-openfort","dir":"with-openfort/frontend","pm":"pnpm","build":"build","node":"22"},
103+ {"name":"with-turnkey","dir":"with-turnkey","pm":"pnpm","build":"build","node":"22"}
88104 ]'
89105 MATRIX=$(jq -cn --argjson full "$FULL" --argjson changed "$CHANGED" \
90106 '{include: [ $full[] | select(.name as $n | ($changed | index($n)) != null) ]}')
@@ -101,15 +117,15 @@ jobs:
101117 matrix : ${{ fromJSON(needs.changes.outputs.matrix) }}
102118 name : ${{ matrix.name }}
103119 steps :
104- - uses : actions/checkout@v4
120+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
105121
106- - uses : actions/setup-node@v4
122+ - uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
107123 with :
108124 node-version : ${{ matrix.node }}
109125
110126 - name : Install pnpm
111127 if : matrix.pm == 'pnpm'
112- uses : pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
128+ uses : pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
113129 with :
114130 version : 11
115131
@@ -134,6 +150,7 @@ jobs:
134150 run : |
135151 echo "NEXT_PUBLIC_FORMO_ANALYTICS_WRITE_KEY=ci_test_key" > with-next-app-router/packages/nextjs/.env
136152
153+
137154 - name : Install dependencies
138155 working-directory : ${{ matrix.dir }}
139156 shell : bash
@@ -151,6 +168,10 @@ jobs:
151168 esac
152169
153170 - name : Build
171+ # Crossmint's SDK cryptographically validates the API key at build-time
172+ # during prerender, so a synthetic placeholder can't get the build past
173+ # static generation. The audit job still covers `with-crossmint`.
174+ if : matrix.name != 'with-crossmint'
154175 working-directory : ${{ matrix.dir }}
155176 shell : bash
156177 env :
@@ -164,3 +185,40 @@ jobs:
164185 bun) bun run "$BUILD_SCRIPT" ;;
165186 *) npm run "$BUILD_SCRIPT" ;;
166187 esac
188+
189+ # Parallel to `build`. Reuses the same matrix so audit only runs against
190+ # changed examples. Fails the PR on high/critical advisories; moderate and
191+ # low are still printed but don't break the check (tune `--audit-level` to
192+ # `moderate` later if stricter coverage is wanted).
193+ audit :
194+ needs : changes
195+ if : ${{ needs.changes.outputs.any == 'true' }}
196+ runs-on : ubuntu-latest
197+ strategy :
198+ fail-fast : false
199+ matrix : ${{ fromJSON(needs.changes.outputs.matrix) }}
200+ name : audit (${{ matrix.name }})
201+ steps :
202+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
203+
204+ - uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
205+ with :
206+ node-version : ${{ matrix.node }}
207+
208+ - name : Install pnpm
209+ if : matrix.pm == 'pnpm'
210+ uses : pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
211+ with :
212+ version : 11
213+
214+ - name : Audit production dependencies
215+ if : matrix.pm == 'pnpm'
216+ working-directory : ${{ matrix.dir }}
217+ shell : bash
218+ env :
219+ # Default gate is `high`. Specific examples carry their own
220+ # `audit` value in the matrix when their dep tree has known
221+ # unfixable transitive findings (e.g. bigint-buffer has no
222+ # patched upstream release yet).
223+ AUDIT_LEVEL : ${{ matrix.audit || 'high' }}
224+ run : pnpm audit --prod --audit-level=$AUDIT_LEVEL
0 commit comments