-
Notifications
You must be signed in to change notification settings - Fork 33
43 lines (40 loc) · 1.21 KB
/
npm-audit.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Daily - npm audit
on:
schedule:
# run daily at midnight
- cron: '0 0 * * *'
jobs:
build:
if: github.repository == 'adobe/aio-cli'
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: [16]
os: [ubuntu-latest]
steps:
- name: Setup CLI
uses: adobe/[email protected]
with:
os: ${{ matrix.os }}
- id: createandaudit
name: create app and audit
run: |
mkdir testapp
cd testapp
aio app init -y --no-login --standalone-app
npm audit --audit-level=high --json > auditoutput.txt
- id: runaudit
name: if audit had failed, run npm audit without json flag so we can see what is failing
if: failure() && steps.createandaudit.outcome != 'success'
run: |
cd testapp
npm audit
- id: postslackmessage
name: Slack Notification
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_TITLE: 'npm audit'
SLACK_MESSAGE: ${{ env.issueurl || 'Vulnerabilities found' }}
SLACK_COLOR: ${{ job.status == 'success' && 'good' || job.status == 'cancelled' && '#808080' || 'danger' }}