Skip to content

GitHub ActionsのusesをコミットSHAにピン留め (Closes #1499)#1522

Merged
TinyKitten merged 1 commit into
devfrom
feature/pin-actions-to-sha-1499
May 15, 2026
Merged

GitHub ActionsのusesをコミットSHAにピン留め (Closes #1499)#1522
TinyKitten merged 1 commit into
devfrom
feature/pin-actions-to-sha-1499

Conversation

@TinyKitten
Copy link
Copy Markdown
Member

@TinyKitten TinyKitten commented May 15, 2026

概要

ECSデプロイワークフロー(ステージング・本番)の GitHub Actions uses: 参照をバージョンタグ(@v*)から完全長のコミット SHA に変更し、確定的・再現可能なデプロイとサプライチェーン上のセキュリティを強化する。元タグは # v4 のようにコメントで併記して Dependabot が追従できる形を維持。

変更の種類

  • バグ修正
  • 新機能
  • データの修正・追加
  • リファクタリング
  • ドキュメント
  • CI/CD
  • その他

変更内容

.github/workflows/deploy_ecs_staging_stationapi.yml および .github/workflows/deploy_ecs_production_stationapi.yml の以下 5 アクションをコミット SHA に固定(両ファイルとも同じ SHA を使用)。

  • actions/checkout@v4actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
  • aws-actions/configure-aws-credentials@v4aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4
  • aws-actions/amazon-ecr-login@v2aws-actions/amazon-ecr-login@fa648b43de3d4d023bcb3f89ed6940096949c419 # v2
  • aws-actions/amazon-ecs-render-task-definition@v1aws-actions/amazon-ecs-render-task-definition@6853cfae8c3a7d978fbf68b5a55453395541dfbb # v1
  • aws-actions/amazon-ecs-deploy-task-definition@v2aws-actions/amazon-ecs-deploy-task-definition@a310a830f5c14e583e35d84e4e1ec7dd177c3c9c # v2

各 SHA は GitHub API(repos/<owner>/<repo>/git/ref/tags/<tag>)で当該タグが指す実コミットを参照して取得。configure-aws-credentials@v4 は annotated tag のため、タグオブジェクトから実コミット SHA を解決した。

テスト

  • cargo fmt --all -- --check が通ること
  • cargo clippy -- -D warnings が通ること
  • cargo testSQLX_OFFLINE=true)が通ること

省略: コード(stationapi/** ほか)の変更なし、ワークフローファイルのみの変更のため cargo チェックは対象外。

関連Issue

Closes #1499

スクリーンショット(任意)

Summary by CodeRabbit

Release Notes

  • Chores
    • デプロイワークフローのセキュリティと安定性を強化するため、本番環境およびステージング環境で使用するGitHub Actionsを特定のバージョンに固定しました。

Review Change Stack

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@TinyKitten TinyKitten self-assigned this May 15, 2026
@github-actions github-actions Bot added feature 要望対応や課題解決 ci/cd deploy-dev labels May 15, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7b6eba15-b392-4d67-96fa-f963587b354a

📥 Commits

Reviewing files that changed from the base of the PR and between ba9da5a and 485dbdc.

📒 Files selected for processing (2)
  • .github/workflows/deploy_ecs_production_stationapi.yml
  • .github/workflows/deploy_ecs_staging_stationapi.yml

📝 Walkthrough

Walkthrough

本番・ステージング環境のECSデプロイワークフローにおいて、GitHub Actionsの参照がメジャーバージョンタグ(@v4@v2@v1)から特定のコミットSHAに固定される。ワークフロー構造と入出力は変更されない。

Changes

GitHub Actions SHA固定

Layer / File(s) Summary
Production ECS deployment action pinning
.github/workflows/deploy_ecs_production_stationapi.yml
actions/checkoutaws-actions/configure-aws-credentialsaws-actions/amazon-ecr-loginaws-actions/amazon-ecs-render-task-definitionaws-actions/amazon-ecs-deploy-task-definitionの参照が、バージョンタグから特定のコミットSHAに更新される。
Staging ECS deployment action pinning
.github/workflows/deploy_ecs_staging_stationapi.yml
本番環境と同じ5つのGitHub Actionsの参照が、バージョンタグから特定のコミットSHAに更新される。

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested labels

ci/cd

Poem

ウサギは駆ける、SHAで堅固に 🐰
タグではなくコミットで留める
セキュアなデプロイ、確定的に
本番も本番も、今、同じく
再現性のうた、SHA万歳! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PR タイトルは GitHub Actions の uses をコミット SHA に固定するという主要な変更を明確に要約している。
Description check ✅ Passed PR 説明は必須セクション(概要、変更の種類、変更内容、関連 Issue)をすべて記載しており、変更の詳細が十分に記述されている。
Linked Issues check ✅ Passed PR は Issue #1499 で指定された 2 つのワークフローファイル内の 5 つのアクションすべてを対応するコミット SHA に固定しており、要件を完全に満たしている。
Out of Scope Changes check ✅ Passed 変更はワークフローファイル内の GitHub Actions uses 参照の固定に限定されており、Issue #1499 の範囲内に完全に収まっている。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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/pin-actions-to-sha-1499

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

@TinyKitten TinyKitten merged commit 97dc515 into dev May 15, 2026
3 checks passed
@TinyKitten TinyKitten deleted the feature/pin-actions-to-sha-1499 branch May 15, 2026 14:11
@TinyKitten TinyKitten mentioned this pull request May 15, 2026
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd deploy-dev feature 要望対応や課題解決

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitHub Actions の uses をコミット SHA に固定する(ステージング・本番デプロイワークフロー)

1 participant