Skip to content

feat(hooks): run zizmor offline after workflow edits - #295

Merged
furedea merged 1 commit into
mainfrom
feat/gha-zizmor-edit-hook
Oct 22, 2026
Merged

furedea merged 1 commit into
mainfrom
feat/gha-zizmor-edit-hook

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

概要

agent が .github/workflows/ のワークフローを編集した直後に,actionlint に続けて zizmor --offline を実行する.あわせて dev shell に actionlint を追加する.

背景

編集フックは actionlint しか実行しておらず,zizmor の指摘(権限過多,テンプレートインジェクションなど)はコミット後の CI まで分からなかった.オフラインモードは GitHub API を呼ばず,1 ファイルあたり約 0.03 秒で終わる.また lefthook.yml は actionlint を実行するが,dev shell には入っていなかった.

変更内容

  • agents/hooks/lib/formatter_policy.py:actionlint_plan を workflow_plan に改名し,gha キーはそのまま維持.ワークフロー YAML に actionlint -oneline → zizmor --offline --no-progress --format plain の順で 2 ステップを返す.zizmor は指摘があると非ゼロで終了するため,actionlint と同じく失敗として扱われる.ツール未導入時の動作は他のステップと同じ
  • flake.nix:dev shell の packages に actionlint を追加
  • テスト(先に追加):ワークフローは両ステップを順に持つ,ワークフロー以外の YAML はどちらも持たない,zizmor の失敗が後続ステップに消されない,zizmor 未導入時に対象ファイル付きで通知して後続を止める

確認

  • uv run --frozen pytest tests/agents:2299 件成功
  • nix flake check:成功
  • lefthook(pre-commit,commit-msg):成功

Refs #264

🤖 Generated with Claude Code

Lint workflow files with zizmor --offline after actionlint so agent edits
get security findings without calling the GitHub API. Add actionlint to
the dev shell so lefthook works under nix develop.

Refs #264

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@furedea
furedea merged commit 2085ee6 into main Oct 22, 2026
11 checks passed
@furedea
furedea deleted the feat/gha-zizmor-edit-hook branch October 22, 2026 14:10
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.

1 participant