fix: DependaBot以外のPRにチェックが表示される問題を修正#243
Merged
Merged
Conversation
pull_request_targetはすべてのPRでトリガーされるため、 DependaBot以外のPRにもskippedチェックが表示されていた。 pushイベント+dependabot/**ブランチパターンに変更し、 DependaBotのブランチへのpush時のみ実行されるようにした。 dependabot/fetch-metadataの代わりにgo.modの差分から パッケージ情報を取得するよう変更。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
gh pr merge --autoはgit操作を内部で実行するため、 gitリポジトリコンテキストが解決できず "fatal: not a git repository"エラーが発生していた。 --repo フラグでリポジトリを明示することで解消する。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
/migrateの絶対パス指定ではCMDと同じ./migrateで実行できない。 mainと同じパターンでカレントディレクトリにコピーすることで ./migrateで実行可能にする。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Code Metrics Report
Reported by octocov |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #
実装内容
問題
pull_request_targetはすべてのPRでトリガーされるため、DependaBot以外のPRでも「Dependabot Auto Merge / auto-merge (skipped)」というチェックが表示されていた。原因
GitHub Actionsの仕様上、ジョブの
if条件でfalseになりスキップされたジョブも、GitHub Checks APIに "neutral" ステータスとしてエントリが作られPRに表示される。修正内容
pull_request_targetをpush+dependabot/**ブランチパターンに変更した。これにより、DependaBotのブランチへのプッシュ時のみワークフローが実行され、他のPRには一切表示されない。
また、
dependabot/fetch-metadataアクションはpull_request_targetコンテキストが必要なため、代わりにgit diff HEAD~1 -- go.modから更新パッケージ名・バージョンを直接取得するよう変更した。動作確認
エビデンス
go.modの差分解析でパッケージ名とバージョンが正しく抽出されることを確認テスト結果