File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : npm audit
2
+
3
+ on :
4
+ workflow_dispatch :
5
+
6
+ pull_request :
7
+ branches :
8
+ - master
9
+ paths :
10
+ - " yarn.lock"
11
+ - " .github/workflows/**"
12
+
13
+ schedule :
14
+ - cron : ' 0 0 * * 0' # Every sunday at midnight
15
+
16
+ jobs :
17
+ audit :
18
+ runs-on : ubuntu-latest
19
+ env :
20
+ NODE_VERSION : 18.x
21
+ AVOID_LICENSES : " AGPL;GPL;AGPL-3.0"
22
+ IGNORE_PACKAGES : " "
23
+
24
+ steps :
25
+ - name : Checkout
26
+ uses : actions/checkout@v2
27
+ with :
28
+ persist-credentials : false
29
+ - name : Use Node.js ${{ env.NODE_VERSION }}
30
+ uses : actions/setup-node@v1
31
+ with :
32
+ node-version : ${{ env.NODE_VERSION }}
33
+
34
+ - name : Install dependencies
35
+ run : |
36
+ yarn install
37
+
38
+ - name : Check licenses
39
+ run : npx --yes license-checker --production --failOn "${{ env.AVOID_LICENSES }}" --excludePackages "${{ env.IGNORE_PACKAGES }}"
40
+
41
+ - name : Run audit
42
+ run : /bin/bash -c "(yarn audit --groups 'dependencies' --level critical; [[ $? -ge 16 ]] && exit 1 || exit 0)"
You can’t perform that action at this time.
0 commit comments