Skip to content

chore(audit): stream-json GHSA-528h-pc64-c93x を到達性ゼロで受容 (allowlist + §7.13) #1463

chore(audit): stream-json GHSA-528h-pc64-c93x を到達性ゼロで受容 (allowlist + §7.13)

chore(audit): stream-json GHSA-528h-pc64-c93x を到達性ゼロで受容 (allowlist + §7.13) #1463

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
env:
# actions/checkout@v4 等の JS-based action 自体を Node.js 24 で実行させる。
# GitHub は 2026-06-02 から Node.js 20 を deprecate (動作はするが warning)、
# 2026-09-16 に完全停止。設定なしだと CI ログに deprecation warning が出続ける。
# この env は action runtime のみに作用し、setup-node@v4 で指定する node-version
# (我々の test runtime) には影響しない。
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm
- run: npm ci
- run: npm run typecheck
# Next build の lint 対象外 (hooks/tests/scripts/e2e/instrumentation 等) も含め、
# bypass 可能な pre-commit hook に依存せずリポ全体を機械的に検査する。
- run: npm run lint
# scripts/run-tests.mjs は vitest を forks pool / maxForks=2 で起動し、
# JSON reporter の numFailedTests を真の合否ソースとして使う。
# PaymentForm / CheckoutForm / TipForm 系で観測される post-teardown
# "Worker exited unexpectedly" は全 assertion が pass している状態の
# cleanup OOM なので fail とは扱わない (script 内で別途 warning を残す)。
- run: node scripts/run-tests.mjs
# カバレッジは gate (2026-09-02): 以前は continue-on-error で赤くならず、
# 閾値 (vitest.config.ts の coverage.thresholds) が事実上無効だった。
# 閾値は実測 -2pt で回帰のみを検出する設定なので、割れたら「テストの無い分岐が増えた」の合図。
- name: Coverage
run: node --max-old-space-size=6144 ./node_modules/.bin/vitest run --coverage --pool=forks --poolOptions.forks.minForks=1 --poolOptions.forks.maxForks=2
- name: Build (production) + bundle budget check
env:
NEXT_PUBLIC_NETWORK_ENV: testnet
NEXT_PUBLIC_PIMLICO_API_KEY: ci_dummy_key
NEXT_PUBLIC_FEE_RECEIVER_ADDRESS: '0x000000000000000000000000000000000000dEaD'
run: |
# build ログを保存して、後で bundle 予算チェックに食わせる
npm run build 2>&1 | tee build.log
# Route 別 First Load JS の予算超過を fail させる
node scripts/check-bundle-budget.mjs < build.log
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm
# MODERATE / HIGH / CRITICAL の advisory gate。scripts/audit-gate.mjs は
# 受容済 advisory を allowlist で許容し、それ以外の MODERATE+ で fail
# させる。受容済の根拠は docs/DEPLOY_CHECKLIST.md §7、allowlist 本体は
# scripts/audit-gate.mjs の ALLOWED_ADVISORIES。新規 advisory 出現時は
# 監査 trail として両者を同時 update して PR レビューする運用。
# (旧: HIGH+ のみ gate、moderate は warning。2026-05-22 に moderate も
# gating へ昇格させ、新規 moderate を必ず人が評価する policy に変更)
- run: node scripts/audit-gate.mjs
# 依存の取得元 gate (2026-07-20 採用): 全 package-lock.json が公式 npm
# レジストリのみから解決されていることを検査。git URL / 独自レジストリ /
# http 取得の混入 (AI エージェント経由のサプライチェーン汚染含む) で fail。
- run: node scripts/lockfile-gate.mjs