File tree Expand file tree Collapse file tree 1 file changed +65
-0
lines changed
Expand file tree Collapse file tree 1 file changed +65
-0
lines changed Original file line number Diff line number Diff line change 9999 - name : Lint
100100 run : npm run lint
101101
102+ npm-audit :
103+ name : Security - NPM Audit
104+ runs-on : ubuntu-latest
105+ steps :
106+ - name : Checkout
107+ uses : actions/checkout@v4
108+
109+ - name : Setup Node.js
110+ uses : actions/setup-node@v4
111+ with :
112+ node-version : ${{ inputs.node-version }}
113+ cache : ' npm'
114+
115+ - name : Cache dependencies
116+ uses : actions/cache@v3
117+ id : node-modules-cache
118+ with :
119+ path : ' **/node_modules'
120+ key : ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
121+ restore-keys : |
122+ ${{ runner.os }}-modules-
123+
124+ - name : Install dependencies
125+ if : steps.node-modules-cache.outputs.cache-hit != 'true'
126+ run : npm ci
127+
128+ - name : Run npm audit
129+ run : npm audit --audit-level=moderate
130+
131+ trivy-scan :
132+ name : Security - Trivy Scan
133+ runs-on : ubuntu-latest
134+ steps :
135+ - name : Checkout
136+ uses : actions/checkout@v4
137+
138+ - name : Setup Node.js
139+ uses : actions/setup-node@v4
140+ with :
141+ node-version : ${{ inputs.node-version }}
142+ cache : ' npm'
143+
144+ - name : Cache dependencies
145+ uses : actions/cache@v3
146+ id : node-modules-cache
147+ with :
148+ path : ' **/node_modules'
149+ key : ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
150+ restore-keys : |
151+ ${{ runner.os }}-modules-
152+
153+ - name : Install dependencies
154+ if : steps.node-modules-cache.outputs.cache-hit != 'true'
155+ run : npm ci
156+
157+ - name : Run Trivy vulnerability scanner
158+ uses : aquasecurity/trivy-action@master
159+ with :
160+ scan-type : ' fs'
161+ scan-ref : ' .'
162+ format : ' table'
163+ severity : ' CRITICAL,HIGH'
164+ exit-code : ' 1'
165+ ignore-unfixed : true
166+
102167 test :
103168 name : Test
104169 runs-on : ubuntu-latest
You can’t perform that action at this time.
0 commit comments