Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,64 @@ jobs:

- run: npm run prettier

security:
name: Security Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install dependencies
run: npm ci

- name: Run npm audit for vulnerabilities
run: |
echo "=== Running npm audit on all 29 dependencies ==="
echo "Scanning: @modelcontextprotocol/sdk, cheerio, react, express, playwright, and 24 other packages"
npm audit --audit-level=moderate --json > audit-results.json || true

if [ -s audit-results.json ]; then
echo "✓ Security audit completed"
VULN_COUNT=$(cat audit-results.json | grep -o '"total":[0-9]*' | head -1 | grep -o '[0-9]*' || echo "0")
echo "Vulnerabilities found: $VULN_COUNT"

if [ "$VULN_COUNT" -gt "0" ]; then
echo "⚠️ Vulnerabilities detected - review required"
cat audit-results.json
else
echo "✓ No vulnerabilities found"
fi
fi

- name: Verify package-lock.json integrity
run: |
echo "=== Verifying package-lock.json integrity hashes ==="
if grep -q "\"integrity\":" package-lock.json; then
echo "✓ Integrity hashes present in package-lock.json"
HASH_COUNT=$(grep -c "\"integrity\":" package-lock.json || echo "0")
echo "Found $HASH_COUNT integrity hashes protecting dependencies"
else
echo "⚠️ No integrity hashes found"
exit 1
fi

- name: Check for outdated dependencies
run: |
echo "=== Checking for outdated dependencies ==="
npm outdated || true
echo "✓ Dependency freshness check completed"

- name: Upload audit results
uses: actions/upload-artifact@v4
if: always()
with:
name: security-audit-results
path: audit-results.json
retention-days: 30

e2e:
runs-on: ubuntu-latest
steps:
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"build": "npm run generate:schemas && npm run sync:snippets && node scripts/run-bun.mjs build.bun.ts",
"prepack": "npm run build",
"build:all": "npm run examples:build",
"prepublishOnly": "npm audit --audit-level=high",
"test": "bun test src",
"test:e2e": "playwright test",
"test:e2e:update": "playwright test --update-snapshots",
Expand All @@ -69,7 +70,9 @@
"prettier": "prettier -u \"**/*.{js,jsx,ts,tsx,mjs,json,md,yml,yaml}\" --check",
"prettier:fix": "prettier -u \"**/*.{js,jsx,ts,tsx,mjs,json,md,yml,yaml}\" --write",
"check:versions": "node scripts/check-versions.mjs",
"update-lock:docker": "rm -rf node_modules package-lock.json examples/*/node_modules && docker run --rm --platform linux/amd64 -v $(pwd):/work -w /work -e HOME=/tmp node:latest npm i --registry=https://registry.npmjs.org/ --ignore-scripts && rm -rf node_modules examples/*/node_modules && npm i --registry=https://registry.npmjs.org/"
"update-lock:docker": "rm -rf node_modules package-lock.json examples/*/node_modules && docker run --rm --platform linux/amd64 -v $(pwd):/work -w /work -e HOME=/tmp node:latest npm i --registry=https://registry.npmjs.org/ --ignore-scripts && rm -rf node_modules examples/*/node_modules && npm i --registry=https://registry.npmjs.org/",
"audit": "npm audit --audit-level=moderate",
"audit:fix": "npm audit fix"
},
"author": "Olivier Chafik",
"devDependencies": {
Expand Down