diff --git a/.github/workflows/security-guard.yml b/.github/workflows/security-guard.yml new file mode 100644 index 0000000..ecf5b6b --- /dev/null +++ b/.github/workflows/security-guard.yml @@ -0,0 +1,28 @@ +name: Security Guard +on: + pull_request: + types: [opened, synchronize, reopened] + schedule: + - cron: "17 3 * * *" + workflow_dispatch: +permissions: + contents: read +jobs: + npm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + - name: Verify npm projects + shell: bash + run: | + set -e + while IFS= read -r p; do + d="$(dirname "$p")" + npm install --ignore-scripts --no-audit --prefix "$d" + npm audit --audit-level=high --prefix "$d" + npm run build --if-present --prefix "$d" + npm test --if-present --prefix "$d" + done < <(find . -name package.json -not -path '*/node_modules/*' -not -path './.git/*' -print)