Skip to content

chore: GitHub Actions を commit SHA でピン留め#3

Merged
nanasess merged 1 commit into
mainfrom
feature/actions-commit-hash
Apr 21, 2026
Merged

chore: GitHub Actions を commit SHA でピン留め#3
nanasess merged 1 commit into
mainfrom
feature/actions-commit-hash

Conversation

@nanasess
Copy link
Copy Markdown
Contributor

@nanasess nanasess commented Apr 21, 2026

概要

supply-chain 対策として、すべての GitHub Actions を mutable なタグ参照から不変の commit SHA 参照に切り替えます。あわせて Dependabot 設定を追加し、ピン留め後も継続的にアップデートされる運用にします。

変更内容

  • .github/workflows/ci.yml / publish-nuget.ymluses:owner/repo@<40文字SHA> # vX.Y.Z 形式に変換(pinact 3.9.0 で自動生成)
  • .github/dependabot.yml を新規作成
    • github-actions: 月曜 09:00 JST / PR 上限 5
    • nuget: 火曜 09:00 JST / PR 上限 10

動機

  • タグ(@v4 等)は mutable で、Action 作者アカウント侵害時に @v4 が差し替えられた場合、次回 CI 実行時に汚染コードが取り込まれる
  • OpenSSF / GitHub Security hardening guide でもサードパーティ Actions は完全な SHA でピンすることが推奨
  • バージョンコメント(# vX.Y.Z)は Dependabot が SHA 自動更新する際の識別子として必要

動作確認

  • CI (ci.yml) が緑で通過
  • タグ push 時の publish-nuget.yml がマージ後の別タグで動作確認予定

関連

EcAuth organization 配下のほかのリポジトリ(EcAuth / EcAuth.MockIdP / ecauth-infrastructure / ecauth-website / ecauth-auth-js)でも同一方針で順次対応します。

🤖 Generated with Claude Code

Summary by CodeRabbit

リリースノート

  • Chores
    • 自動化された依存関係アップデート機能を追加しました。
    • GitHub Actionsの参照をコミットSHAにより固定化し、ワークフロー実行の一貫性と信頼性を向上させました。

- `.github/workflows/*.yml` の全 `uses:` を `@<40文字 SHA> # vX.Y.Z` 形式に変換
  (pinact 3.9.0 で自動生成)
- Dependabot に `github-actions` / `nuget` エコシステムを追加し、
  SHA ピン留め後も週次で自動アップデートされるようにする

Supply-chain 対策として、サードパーティ Actions のミュータブルなタグ参照を
不変の commit SHA に固定する。
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

📝 Walkthrough

Walkthrough

新しいDependabotコンフィギュレーションファイルを追加し、GitHubアクションズとNuGetパッケージの自動依存性更新を有効化しました。また、CI/CDワークフローを更新して、GitHubアクションズへの参照をバージョンタグから特定のコミットSHAに変更しました。

Changes

Cohort / File(s) Summary
Dependabot Configuration
.github/dependabot.yml
Dependabotの自動依存性更新を設定。GitHubアクションズは毎週月曜日09:00(Asia/Tokyo)、NuGetパッケージは毎週火曜日09:00(Asia/Tokyo)に更新をスケジュール。各エントリに対してプルリクエスト数の上限、ラベル、コミットメッセージプレフィックスを指定。
Workflow Files
.github/workflows/ci.yml, .github/workflows/publish-nuget.yml
GitHubアクションズの参照をバージョンタグ(@v4)から特定のコミットSHA参照に変更。actions/checkoutactions/setup-dotnetのステップを更新。

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 ウサギが新しい依存性をお手伝い
Dependabotがやってきて、更新は自動化
コミットSHAで安全に、毎週きちんと
GitHubのお庭も整理整頓ね!
パッと見直してセキュリティ〜✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PRのタイトルは GitHub Actions の commit SHA へのピン留めという主要な変更を明確に説明しており、変更内容と完全に関連している。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/actions-commit-hash

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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/dependabot.yml (1)

35-36: オプション:allow セクションは省略可能です。

dependency-type: "all" は Dependabot のデフォルト動作なため、この allow セクションは技術的には不要です。ただし、明示的に記述することで意図が明確になるため、現状のままでも問題ありません。

♻️ 簡略化する場合の提案
     commit-message:
       prefix: "chore"
       include: "scope"
-    allow:
-      - dependency-type: "all"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/dependabot.yml around lines 35 - 36, The allow block specifying
dependency-type: "all" is redundant because Dependabot defaults to all
dependency types; remove the allow section (the allow key and its
dependency-type entry) from .github/dependabot.yml to simplify the config, or if
you prefer explicitness, leave it as-is—locate the allow key and the
dependency-type: "all" entry and delete them to implement the simplification.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/dependabot.yml:
- Around line 35-36: The allow block specifying dependency-type: "all" is
redundant because Dependabot defaults to all dependency types; remove the allow
section (the allow key and its dependency-type entry) from
.github/dependabot.yml to simplify the config, or if you prefer explicitness,
leave it as-is—locate the allow key and the dependency-type: "all" entry and
delete them to implement the simplification.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7bf500a1-6231-456d-be05-7d46a211c8b8

📥 Commits

Reviewing files that changed from the base of the PR and between 2f49501 and b2c3d0a.

📒 Files selected for processing (3)
  • .github/dependabot.yml
  • .github/workflows/ci.yml
  • .github/workflows/publish-nuget.yml

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a .github/dependabot.yml configuration to automate dependency updates for GitHub Actions and .NET NuGet packages on a weekly schedule. The feedback suggests grouping official GitHub Actions to minimize pull request noise and improve maintainability.

Comment thread .github/dependabot.yml
Comment on lines +5 to +18
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
timezone: "Asia/Tokyo"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "github-actions"
commit-message:
prefix: "chore"
include: "scope"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

GitHub Actions の更新について、actions/* などの公式アクションをグループ化することをお勧めします。これにより、複数のアクションが同時に更新された際の PR ノイズを減らすことができます。

  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "weekly"
      day: "monday"
      time: "09:00"
      timezone: "Asia/Tokyo"
    open-pull-requests-limit: 5
    labels:
      - "dependencies"
      - "github-actions"
    commit-message:
      prefix: "chore"
      include: "scope"
    groups:
      github-actions:
        patterns:
          - "actions/*"

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