Skip to content

Use npm ci --ignore-scripts in deploy workflow - #85

Merged
fumikito merged 2 commits into
mainfrom
fix/npm-ci-ignore-scripts
Jul 7, 2026
Merged

Use npm ci --ignore-scripts in deploy workflow#85
fumikito merged 2 commits into
mainfrom
fix/npm-ci-ignore-scripts

Conversation

@fumikito

Copy link
Copy Markdown
Member

Summary

  • Replace npm install with npm ci --ignore-scripts in deploy.yml
  • Prevents execution of postinstall/lifecycle scripts during CI, mitigating supply chain attacks
  • No functional impact: deploy workflow doesn't need husky hooks or other lifecycle scripts

Test plan

  • Deploy workflow still builds and deploys correctly on next release

@claude

claude Bot commented Mar 31, 2026

Copy link
Copy Markdown

AI トリアージ: PR #85

リスク: 🟢 低(CI設定のみ)
スコープ: `scope:config`
不足: なし

サマリー

  • デプロイワークフローの `npm install` を `npm ci --ignore-scripts` に変更し、サプライチェーン攻撃リスクを低減する
  • `npm run package`(ビルドスクリプト)は引き続き実行されるため、成果物への影響なし
詳細レビュー

テスト要否

  • ⚪ テスト不要: .github/workflows/deploy.yml — CI設定変更のみ

レビュワーが確認すべき箇所

  1. .github/workflows/deploy.yml:35npm run package が postinstall スクリプト(例: prepare で生成されるファイル)に依存していないか確認。通常は問題ないが、念のためデプロイ実行ログで確認推奨。

設計上の懸念

  • npm ci の副作用: npm cinode_modules を削除してからクリーンインストールするため、キャッシュが効く場合は意図的な動作。現在のワークフローにキャッシュステップがなければ差異なし。
  • --ignore-scripts の範囲: インストール時のライフサイクルスクリプト(postinstall, prepare 等)が無効化される。husky 等の Git フック設定スクリプトも含まれるが、デプロイ環境では不要なので正しい判断。
  • 変更は1行のみで影響範囲が明確。承認推奨

🤖 このレビューは AI によって自動生成されました。

@fumikito
fumikito merged commit c62e8df into main Jul 7, 2026
10 checks passed
@fumikito
fumikito deleted the fix/npm-ci-ignore-scripts branch July 7, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant