Skip to content

Conversation

@ikura-hamu
Copy link
Member

@ikura-hamu ikura-hamu commented Sep 18, 2025

User description

fix #1363


PR Type

Enhancement, Other


Description

  • GitHub Actionsをコミットハッシュでピン留め

  • 併せてバージョンコメントを明記

  • セキュリティと再現性を向上


Diagram Walkthrough

flowchart LR
  workflows["GitHub Workflows *.yaml"] -- "actionsの参照方式変更" --> pin["コミットハッシュ固定 (pin)"]
  pin -- "安定性/セキュリティ向上" --> outcome["再現性の高いCI/CD"]
Loading

File Walkthrough

Relevant files
Enhancement
ai-review.yaml
pr-agentアクションをハッシュで固定                                                                       

.github/workflows/ai-review.yaml

  • Codium-ai/pr-agentをコミットハッシュに固定
  • コメントでv0.30を明記
+1/-1     
ci.yaml
CI全体のActionsをコミットハッシュで固定                                                                 

.github/workflows/ci.yaml

  • actions/checkout等をハッシュ固定化
  • setup-go, setup-atlasをハッシュ固定化
  • codecov, upload-artifact, golangci-lintを固定
  • spectral-actionなど周辺ツールも固定
+15/-15 
deploy-ci.yaml
デプロイCIのActionsをハッシュ固定                                                                       

.github/workflows/deploy-ci.yaml

  • checkoutをハッシュ固定化
  • Docker関連アクションをハッシュ固定化
  • ssh-key-actionをハッシュ固定化
+6/-6     
release.yaml
リリースワークフローのActionsをハッシュ固定                                                               

.github/workflows/release.yaml

  • checkoutをハッシュ固定化
  • Docker系(qemu/buildx/login/build-push)を固定
  • バージョンコメントを併記
+5/-5     

@github-actions
Copy link

Migrate lint ✅

Lint output

@github-actions
Copy link

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Security
Dockerデーモンの外部公開防止

2375
はTLSなしのDockerデーモン公開で安全ではありません。可能ならローカルソケットを使うか、少なくとも外部公開を避けてテストに必要な最小権限に制限してください。

外部へのバインドをやめ、DOCKER_HOSTtcp://localhost:2375 に限定するかUNIXソケットを利用する構成に変更しましょう。

.github/workflows/ci.yaml [26-31]

 services:
   dind:
     image: docker:23.0-rc-dind-rootless
+    # 外部へ公開しない(jobs内からlocalhostでのみアクセス)
     ports:
-      - 2375:2375
+      - 127.0.0.1:2375:2375
Suggestion importance[1-10]: 8

__

Why: The snippet matches the new hunk and limiting the port to 127.0.0.1 reduces exposure of an unauthenticated Docker daemon, which is a meaningful security improvement.

Medium
General
バージョンコメントの整合性確保

# v0 のコメントは実際のタグと一致せず将来のメンテで誤解を招きます。固定ハッシュを使うのは良いですが、コメントは解決された実際のバージョンに合わせてください。

一貫してハッシュに対応する正確なバージョンコメントへ更新しましょう。

.github/workflows/ci.yaml [37-39]

 - name: Setup Atlas
-  uses: ariga/setup-atlas@4240bd74ba9f13319a21de2b6e497f2b6d184d76 # v0
+  uses: ariga/setup-atlas@4240bd74ba9f13319a21de2b6e497f2b6d184d76 # corresponds to ariga/setup-atlas v0.x (pin by commit)
Suggestion importance[1-10]: 4

__

Why: The code exists in the new hunk and the suggestion is accurate, but it only refines a comment for clarity with no functional impact.

Low
コメントを実態に合わせ修正

ハッシュ固定は良いですが、コメントの v0.30
と実ハッシュの対応が将来ずれると誤認の原因になります。実際に対応するリリースタグを確認し、コメントを正確にしておくべきです。
あるいは「pin by
commit」と明示し、タグと一致しない可能性を注記してください。

.github/workflows/ai-review.yaml [25]

-uses: Codium-ai/pr-agent@eb4cdbb115dfb711375a24eccc75e3ef73ec03bc # v0.30
+uses: Codium-ai/pr-agent@eb4cdbb115dfb711375a24eccc75e3ef73ec03bc # corresponds to Codium-ai/pr-agent v0.30 (pinned by commit)
Suggestion importance[1-10]: 4

__

Why: The line matches the new hunk and clarifying the version comment helps maintenance, but it's a minor, non-functional improvement.

Low

@ikura-hamu ikura-hamu merged commit 1252346 into main Sep 18, 2025
10 checks passed
@ikura-hamu ikura-hamu deleted the conf/gh_action_commit_hash branch September 18, 2025 06:40
@codecov
Copy link

codecov bot commented Sep 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.73%. Comparing base (470a1eb) to head (2209653).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1373   +/-   ##
=======================================
  Coverage   49.73%   49.73%           
=======================================
  Files         134      134           
  Lines       11738    11738           
=======================================
  Hits         5838     5838           
  Misses       5600     5600           
  Partials      300      300           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

GitHub Actionsで使うactionの指定にコミットハッシュを使うようにする

2 participants