Skip to content

Commit ea19ece

Browse files
committed
add snyk scan to publish flow
1 parent 0ce7e4f commit ea19ece

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

.github/workflows/publish.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,41 @@ name: Publish to npm
33
on:
44
push:
55
tags:
6-
- "v*" # Trigger on version tags like v6.0.0
6+
- "v*"
77

88
permissions:
99
contents: read
10-
id-token: write # Required for OIDC (Trusted Publishing)
10+
id-token: write
11+
security-events: write # Added for Snyk SARIF upload
1112

1213
jobs:
1314
publish:
1415
runs-on: ubuntu-latest
15-
# environment: production # Uncomment for approval gates
1616
steps:
1717
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0 # Needed for Snyk
20+
1821
- uses: actions/setup-node@v4
1922
with:
2023
node-version: "20"
2124
registry-url: "https://registry.npmjs.org"
25+
2226
- name: Update npm
2327
run: npm install -g npm@latest
28+
2429
- run: npm ci
2530
- run: npm run build
26-
- run: cd out && npm publish --access public
31+
32+
# === SNYK integration ===
33+
- name: Install Snyk
34+
run: npm install -g snyk
35+
36+
- name: Auth Snyk
37+
run: snyk auth ${{ secrets.SNYK_TOKEN }}
38+
39+
- name: Snyk Test (fail on high/critical)
40+
run: snyk test --severity-threshold=high
41+
42+
# === Publish (only runs if Snyk passes) ===
43+
- run: cd out && npm publish --access public --provenance

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,9 @@ _Get SARIF output including exact line numbers of violations._
289289

290290
## Installation
291291

292-
`lightning-flow-scanner-core` is published to **npm** only.
292+
`lightning-flow-scanner-core` is published to **npm** and **scanned with Snyk during release**.
293293

294-
[![npm version](https://img.shields.io/npm/v/@flow-scanner/lightning-flow-scanner-core?label=npm)](https://www.npmjs.com/package/@flow-scanner/lightning-flow-scanner-core)
294+
[![npm version](https://img.shields.io/npm/v/@flow-scanner/lightning-flow-scanner-core?label=npm)](https://www.npmjs.com/package/@flow-scanner/lightning-flow-scanner-core) [![Known Vulnerabilities](https://snyk.io/test/github/Flow-Scanner/lightning-flow-scanner-core/badge.svg)](https://snyk.io/test/github/Flow-Scanner/lightning-flow-scanner-core)
295295

296296
**To install with npm:**
297297

0 commit comments

Comments
 (0)