Skip to content

chore: enforce SHA pin via zizmor#7

Merged
taro-28 merged 2 commits into
mainfrom
chore/add-zizmor
May 27, 2026
Merged

chore: enforce SHA pin via zizmor#7
taro-28 merged 2 commits into
mainfrom
chore/add-zizmor

Conversation

@taro-28
Copy link
Copy Markdown
Member

@taro-28 taro-28 commented May 27, 2026

Summary

  • .github/workflows/test.ymllint job に zizmorcore/zizmor-action を追加し、min-severity: high で CI fail させる。これにより Pin third-party actions to full-length commit SHAs #5 で定めた SHA pin ポリシーを CI で強制(unpinned-uses audit は high severity)し、ついでに excessive-permissions / impostor-commit などの致命的な Actions セキュリティ違反も検出する。
  • 上記 audit によって検出された既存違反 excessive-permissionsrelease.yml の workflow-level contents: write)を解消するため、permissions: {} を workflow デフォルトにして、必要な 2 つの job(update-major-tag / create-release)に個別で contents: write を付与する形に変更。
  • pin 形式は Pin third-party actions to full-length commit SHAs #5 ルールに従い zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6
  • advanced-security: false で SARIF upload をスキップし(このリポは Code Scanning 未有効)、annotations: true で違反を GitHub の inline annotation として表示する。
  • job 名を ShellCheckLint に変更(zizmor と並ぶ実態に合わせて)。他 job からは job ID lint で参照しているため互換。

なぜ別 PR か

PR #6 (actionlint 追加) とは目的が異なるため別 PR。actionlint は workflow / inline shell の構文・スキーマ linter で、pin 形式は検出しない。両 PR とも lint job を触るため、後にマージされる側で rebase 解消する想定。

Verification

  • ローカルで zizmor . --min-severity high および zizmor . --min-severity high --no-online-audits の両方で findings 0、exit 0 を確認済み。
  • 既存の bats / integration / cli-install job への影響なし。
  • CI 上でも新規 zizmor ステップが pass することを確認する。

Test plan

  • Test workflow が全 job 成功すること
  • Lint job 内で zizmor ステップが追加され pass すること(unpinned-uses 違反 0 件)
  • release.yml の YAML が壊れておらず、tag push 時の Release workflow が将来も動くこと(実 release tag push まではこの PR では検証しない)

🤖 Generated with Claude Code

taro-28 and others added 2 commits May 27, 2026 15:51
Workflow-level `contents: write` grants the token to every step in
every job, including `actions/checkout`. Narrow it to the two jobs
that actually need it (`update-major-tag` for `git push -f` and
`create-release` for `softprops/action-gh-release`) and default the
workflow to `permissions: {}` (no permissions).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add zizmorcore/zizmor-action to the lint job and run it with
`min-severity: high`. This makes the SHA-pin policy established in
#5 enforceable in CI (the `unpinned-uses` audit is high severity)
and also catches other high-severity Actions security issues such as
`excessive-permissions` and `impostor-commit`.

`advanced-security: false` skips the SARIF upload step (the repo
does not have GitHub Code Scanning enabled) and `annotations: true`
surfaces findings as inline workflow annotations instead. Renamed
the job from `ShellCheck` to `Lint` to reflect the broader scope.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

mock sync output

@github-actions
Copy link
Copy Markdown

mock sync output

@github-actions
Copy link
Copy Markdown

mock sync output

@github-actions
Copy link
Copy Markdown

mock sync output

@taro-28 taro-28 mentioned this pull request May 27, 2026
3 tasks
@taro-28 taro-28 marked this pull request as ready for review May 27, 2026 06:58
@taro-28 taro-28 requested a review from a team as a code owner May 27, 2026 06:58
@taro-28 taro-28 requested review from m-shaka and yebis0942 May 27, 2026 06:58
@taro-28 taro-28 merged commit 839c036 into main May 27, 2026
6 checks passed
@taro-28 taro-28 deleted the chore/add-zizmor branch May 27, 2026 07:06
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.

2 participants