File tree 2 files changed +50
-4
lines changed
2 files changed +50
-4
lines changed Original file line number Diff line number Diff line change
1
+ name : NPM Audit Check
2
+ on :
3
+ push :
4
+ branches : [ main ]
5
+ pull_request :
6
+
7
+ jobs :
8
+ audit :
9
+ runs-on : ubuntu-latest
10
+ strategy :
11
+ fail-fast : false
12
+ matrix :
13
+ node-version : [16.x, 14.x]
14
+ steps :
15
+ - name : Checkout cli repo
16
+ uses : actions/checkout@v2
17
+ with :
18
+ fetch-depth : 0
19
+ - run : make install
20
+ - name : Use Node.js ${{ matrix.node-version }}
21
+ uses : actions/setup-node@v2
22
+ with :
23
+ node-version : ${{ matrix.node-version }}
24
+ cache : ' npm'
25
+ - name : Run audit check
26
+ run : npm audit --audit-level=moderate --production
27
+ # minimum vulnerability level that will cause the command to fail
28
+ # audit reports with low severity would pass the test
29
+ notify-complete-fail :
30
+ if : ${{ failure() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}
31
+ needs : [ audit ]
32
+ name : Notify Npm Audit Failed
33
+ runs-on : ubuntu-latest
34
+ steps :
35
+ - uses : actions/checkout@v2
36
+ - name : Slack Notification
37
+ uses : rtCamp/action-slack-notify@v2
38
+ env :
39
+ SLACK_WEBHOOK : ${{ secrets.ALERT_SLACK_WEB_HOOK }}
40
+ SLACK_COLOR : ' danger'
41
+ SLACK_USERNAME : CLI Github Actions
42
+ SLACK_MSG_AUTHOR : twilio-dx
43
+ SLACK_ICON_EMOJI : ' :github:'
44
+ SLACK_TITLE : " Twilio Cli"
45
+ SLACK_MESSAGE : ' Cli audit test failed'
46
+ MSG_MINIMAL : actions url
47
+ SLACK_FOOTER : Posted automatically using GitHub Actions
Original file line number Diff line number Diff line change 15
15
token-validation :
16
16
runs-on : ubuntu-latest
17
17
steps :
18
- - name : Validate REPO_ACCESS_TOKEN
18
+ - name : Validate REPO_ACCESS_TOKEN
19
19
uses : actions/checkout@v2
20
20
with :
21
21
repository : ' twilio/twilio-oai'
66
66
run : make test
67
67
update-api-specs :
68
68
runs-on : ubuntu-latest
69
- needs : [ token-validation ]
70
- # needs: [test]
69
+ needs : [ test ]
71
70
outputs :
72
71
change-log : ${{ steps.update-specs.outputs.change-log }}
73
72
version-type : ${{ steps.update-specs.outputs.version-type }}
@@ -157,4 +156,4 @@ jobs:
157
156
SLACK_ICON_EMOJI : " :ship:"
158
157
SLACK_TITLE : " Twilio Cli-core"
159
158
SLACK_MESSAGE : ' Release workflow Failed'
160
- MSG_MINIMAL : actions url
159
+ MSG_MINIMAL : actions url
You can’t perform that action at this time.
0 commit comments