Files
evig/.github/workflows/security-audit.yml
d2662cfe22 chore(pnpm): convert to pnpm 11 (#446)
* chore: pnpm — the fleet has one package manager

- packageManager pnpm@11.25.0; lockfile via pnpm import, package-lock.json gone
- npm overrides moved to pnpm-workspace.yaml overrides (pnpm ignores
  package.json overrides); allowBuilds for @parcel/watcher, @sentry/cli,
  @swc/core, esbuild, puppeteer, unrs-resolver, and the ai-forms git dep
  (pnpm requires the exact resolved URL for git-dep prepare builds)
- @tiptap/core added as a direct dependency: RichTextEditor.tsx augments
  'module @tiptap/core' and tiptap-markdown's Storage augmentation rides on
  it — a phantom dependency npm's hoisting hid and pnpm's isolation exposed
- all workflows: pnpm/action-setup@v6 before setup-node, cache: pnpm,
  store-dir pinned, pnpm install --frozen-lockfile; Next cache key now
  hashes pnpm-lock.yaml
- scripts/ci/dependency-audit.sh: pnpm audit --prod (parses both npm-v2
  'vulnerabilities' and pnpm's v1 'advisories' shapes)
- selfhost-deploy-evig.sh, ship.sh, start-all.sh, e2e-inventory-prod.sh,
  husky pre-commit, Dockerfile.prod (node 24 + corepack) converted
- engines: node >=22.13

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

* fix(deps): declare espree — eslint.config.mjs imports it directly

npm's hoisting provided it as a phantom; pnpm's isolated node_modules
exposed ERR_MODULE_NOT_FOUND in CI. Verified in a true clean room
(parent node_modules masked): full verify green, 7783 tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

* fix(deps): declare tsx — npx fetched it on demand, pnpm exec does not

e2e:seed (and the hirn:*/setup-admins scripts) ran 'npx tsx', which
silently downloaded tsx because it was never in devDependencies. pnpm
exec only resolves installed bins, so CI's Seed E2E step died with
'Command tsx not found'. Declare it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

* fix(ci): drop '--' separators — pnpm run forwards them verbatim

npm strips the first '--' before handing args to the script; pnpm 11
passes it through, so 'pnpm run start -- -p 3001' executed
'next start -- -p 3001' and next read '-p' as a project directory.
pnpm forwards everything after the script name anyway, so the
separator is dead weight: remove it in ci.yml (start, e2e journeys,
e2e guards) and ship.sh.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

---------

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-04 12:06:36 +00:00

68 lines
2.1 KiB
YAML

name: Security Audit
# The gap this closes.
#
# On 2026-08-06 three CRITICAL auth advisories (next-auth / @auth/core) were
# open against a live site and nothing was red. Not CI, not the deploy — the
# tree had not changed, so no push-triggered check had any reason to run. They
# surfaced only because a `git push` happened to print GitHub's "found 10
# vulnerabilities" banner, which is not a monitoring system.
#
# Advisories are published on someone else's schedule, against code that merged
# weeks ago. Only a scheduled check can see them. ci.yml's `security` job covers
# the other direction — a PR introducing a critical — and shares the same script.
#
# This run does not block anything. It files one issue and closes it when clean,
# so a new advisory is visible without jamming the merge train.
on:
schedule:
- cron: '17 6 * * *' # daily, offset off the hour to dodge GitHub's cron rush
workflow_dispatch: {}
permissions:
contents: read
issues: write
concurrency:
group: security-audit
cancel-in-progress: false
jobs:
audit:
name: Audit dependencies on main
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout main
uses: actions/checkout@v7
with:
ref: main
# No version input: pnpm/action-setup reads packageManager from package.json.
- uses: pnpm/action-setup@v6
# The action's default store nests inside its own bin dir; a git-dep
# prepare build then dies with TS2742. Pin the store somewhere sane.
- name: Set pnpm store dir
run: pnpm config set store-dir ~/.pnpm-store --global
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: '24'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Audit and report
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
ALERT_ISSUE: '1'
# Reporting only: a newly published advisory should raise an issue,
# not fail a run nobody triggered.
FAIL_ON: none
run: bash scripts/ci/dependency-audit.sh