(build) Add yarn npm audit workflow #4
Workflow file for this run
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: yarn npm audit | |
on: [pull_request] | |
jobs: | |
yarn-npm-audit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- run: yarn install --immutable | |
- name: Run yarn npm audit | |
run: yarn npm audit | |
continue-on-error: true | |
- name: Report any found vulnerabilities | |
if: ${{ failure() }} | |
run: | | |
echo "Vulnerabilities found in dependencies!" | |
yarn npm audit --json | jq -r '.auditAdvisories[] | "\(.title) - \(.url)"' | |
exit 1 |