Skip to content

NPM Audit Signatures #160

NPM Audit Signatures

NPM Audit Signatures #160

name: NPM Audit Signatures
on:
schedule:
- cron: '0 6 * * *' # Daily at 6 AM UTC
push:
branches: [ "main" ]
paths:
- 'package*.json'
pull_request:
branches: [ "main" ]
paths:
- 'package*.json'
permissions:
contents: read
issues: write
pull-requests: write
jobs:
audit-signatures:
name: Audit Package Signatures
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Setup Node.js
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version: '22'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run npm audit
run: npm audit --audit-level=moderate
- name: Verify package signatures
run: npm audit signatures
- name: Check for vulnerabilities
run: |
AUDIT_RESULT=$(npm audit --json)
VULN_COUNT=$(echo "$AUDIT_RESULT" | jq '.vulnerabilities | length')
if [ "$VULN_COUNT" -gt 0 ]; then
echo "::error::Security vulnerabilities found in dependencies ($VULN_COUNT vulnerabilities)"
exit 1
else
echo "No security vulnerabilities found"
fi