NPM Audit #575
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: NPM Audit | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
jobs: | |
audit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Run a security audit | |
run: npx audit-ci --critical --report-type summary | |
- name: Check lock file for invalid hosts | |
run: npx lockfile-lint -s -n -p yarn.lock -a hosts yarn npm | |
- name: Run Dependency confusion supply chain check | |
run: npx snync -d . | |
report: | |
if: ${{ always() && github.repository_owner == 'nrwl' && github.event_name != 'workflow_dispatch' }} | |
needs: audit | |
runs-on: ubuntu-latest | |
name: Report status | |
steps: | |
- name: Send notification | |
uses: ravsamhq/notify-slack-action@v1 | |
with: | |
status: ${{ needs.audit.result }} | |
message_format: '{emoji} *{workflow}* {status_message} (last commit <{commit_url}|{commit_sha}>)' | |
notification_title: '{workflow} has {status_message}' | |
footer: '<{run_url}|View Run>' | |
mention_users: 'U01UELKLYF2,U9NPA6C90' | |
mention_users_when: 'failure,warnings' | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }} | |
report-success: | |
if: ${{ github.repository_owner == 'nrwl' && github.event_name == 'workflow_dispatch' }} # only once it's fixed on manual dispatch | |
needs: audit | |
runs-on: ubuntu-latest | |
name: Report success | |
steps: | |
- name: Send notification | |
uses: ravsamhq/notify-slack-action@v1 | |
with: | |
status: ${{ needs.audit.result }} | |
message_format: '{emoji} *{workflow}* {status_message} (last commit <{commit_url}|{commit_sha}>)' | |
notification_title: '{workflow} has {status_message}' | |
footer: '<{run_url}|View Run>' | |
mention_users: 'U01UELKLYF2,U9NPA6C90' | |
mention_users_when: 'failure,warnings' | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }} |