Skip to content

ci: ワークフロー静的解析(actionlint / zizmor)を追加(#23)#68

Merged
yk-lab merged 1 commit into
mainfrom
ci/workflow-static-analysis
Jul 4, 2026
Merged

ci: ワークフロー静的解析(actionlint / zizmor)を追加(#23)#68
yk-lab merged 1 commit into
mainfrom
ci/workflow-static-analysis

Conversation

@yk-lab

@yk-lab yk-lab commented Jul 4, 2026

Copy link
Copy Markdown
Owner

概要

ワークフローのセキュリティ/構文が手動監査のみだったため、継続的な自動検出を追加する(#23)。core は actionlint(構文/式 + run: の shellcheck)+ zizmor(injection / 過剰権限 / artipacked 等のセキュリティ監査)。

変更内容

  • .github/workflows/lint-workflows.yml(新規): workflow 変更時(paths: .github/workflows/**)に actionlint と zizmor を実行。両ツールとも SHA/バージョンをピンしたバイナリを run: で回し、3rd-party action を増やさない(SHA ピン規約に完全準拠)
    • actionlint: download-actionlint.bash(script を SHA=v1.7.12 でピン)+ binary 1.7.12
    • zizmor: pipx run zizmor==1.26.1(pipx は runner プリインストール、findings で非0 exit)
  • ci.yml: zizmor の excessive-permissions(High)を解消。workflow レベルの id-token: write / pull-requests: write を、実際に使う check(Codecov OIDC/PR コメント)と changes(paths-filter)ジョブへ job-scoped に移動(least-privilege — 実際にセキュリティ向上)
  • TODO.md: [ci] ワークフロー静的解析(actionlint / zizmor)を CI に追加 #23 を解決済みへ

設計判断(actver エージェントで canonical 確認)

  • actionlint/zizmor とも「ピン済みバイナリを run: で実行」= 3rd-party wrapper action を増やさず、ツールのバージョンを明示ピン。供給網を actions/checkout のみに保つ
  • ghalint は 見送り(issue でも任意扱い・zizmor とセキュリティ範囲が重複・全 job への permissions 明示強制で churn 大)。必要なら別 issue

検証

  • ローカルで actionlint clean / zizmor "No findings to report"(全 4 workflow、新規含む)を確認
  • 本 PR は workflow を変更するため、新 lint-workflows.yml が自分自身にも走る(self-validating)
  • codex セカンドオピニオン:bug なし

参照

🤖 Generated with Claude Code


Summary by cubic

GitHub Actions にワークフロー静的解析を追加し、CI の権限を最小化しました。actionlintzizmor を導入し、ci.ymlpermissions をジョブ単位に移して過剰権限を解消。Closes #23

  • New Features

    • 新規 .github/workflows/lint-workflows.yml: ワークフロー変更時のみ実行。actionlint(構文/式 + run: の shellcheck)と zizmor(注入/過剰権限など)を実行。
    • ツールは run: で固定バージョン実行し 3rd-party Action を追加しない。actionlint 1.7.12(installer script は SHA 固定)、zizmor 1.26.1。
  • Refactors

    • ci.ymlpermissions をジョブスコープへ移動して最小化。changespull-requests: readcheckid-token: write / pull-requests: write
    • .github/dependabot.ymlcooldown.default-days: 7 を追加し、供給網のクールダウンを設定(pnpmminimumReleaseAge に揃える)。

Written for commit d8835ea. Summary will update on new commits.

Review in cubic

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

TODO.md で、未対応・進行中の Issue 一覧を差し替え、解決済み Issue の備考一覧に Issue #23 を追加した。

Changes

TODO.md更新

Layer / File(s) Summary
Issue一覧の更新
TODO.md
「未対応・進行中」テーブルで Issue #23 を削除して Issue #9 を追加し、「備考: 既に解決した Issue」テーブルに Issue #23(解決 PR 推定 #68)を追加した。

Estimated code review effort: 1 (Trivial) | ~2 minutes

関連Issue: #23

Poem

ぴょん、とTODOを見なおして
#23 は解決済みの棚へ
#9 が新しくならんで
ぼくは記録をコツンと整える 🐰
次の更新も待ってるよ

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Linked Issues check ❓ Inconclusive 要件の実装対象である .github/workflows/ci.yml.github/workflows/lint-workflows.yml!**/*.yml で除外され、検証できません。 除外されたワークフロー 2 件の差分をレビュー可能にするか、actionlint/zizmor の実行結果を共有してください。
✅ Passed checks (4 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed レビュー可能な差分では要件外の変更は確認できず、現時点で明確な逸脱は見当たりません。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed 主要な変更点である actionlint/zizmor によるワークフロー静的解析の追加を的確に示しています。
Description check ✅ Passed 概要・関連 issue・検証内容が揃っており、テンプレートと完全一致ではないものの十分に具体的です。
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/workflow-static-analysis

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Re-trigger cubic

@yk-lab yk-lab force-pushed the ci/workflow-static-analysis branch from caae954 to 9135319 Compare July 4, 2026 13:10
- .github/workflows/lint-workflows.yml(新規): workflow 変更時に actionlint
  (構文/式 + run: の shellcheck)と zizmor(injection/過剰権限/artipacked 等の
  セキュリティ監査、リポ全体 `.`)を実行。両ツールとも SHA/バージョンピンした
  バイナリを run: で回し 3rd-party action を増やさない
    - actionlint: download-actionlint.bash(script SHA=v1.7.12)+ binary 1.7.12。
      dist/ はリリース時ビルドで未コミットのため `main` 不在の false positive を -ignore
    - zizmor: pipx run zizmor==1.26.1(runner プリインストール)
- ci.yml: zizmor の excessive-permissions(High)を解消。workflow レベルの
  id-token/pull-requests write を check(Codecov)/ changes(paths-filter)へ
  job-scoped 化(least-privilege)
- dependabot.yml: cooldown(default-days: 7)を追加(zizmor dependabot-cooldown、
  pnpm minimumReleaseAge と同じ供給網 cooldown 思想)
- TODO.md: #23 を解決済み(#68)へ

ローカルで actionlint(dist 不在再現)/ zizmor(`.` + GH_TOKEN、CI 一致)とも clean 確認。

Closes #23

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AECzAv2vcdATecuvLjBSa6
@yk-lab yk-lab force-pushed the ci/workflow-static-analysis branch from 9135319 to d8835ea Compare July 4, 2026 15:01
@yk-lab yk-lab merged commit 6bfeb19 into main Jul 4, 2026
23 checks passed
@yk-lab yk-lab deleted the ci/workflow-static-analysis branch July 4, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ci] ワークフロー静的解析(actionlint / zizmor)を CI に追加

1 participant