0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

github actionsのワークフローで設定していたClaude codeコードレビューが突然動かなくなった

Posted at

起こったこと

PRを出したらコードレビューをしてくれるワークフローを設定して、これまではうまく動いてくれていた

ある日、いつもどおりPRを出しても突然動かなくなった

ログ

ワークフローのログには以下が出ていた

Warning: Skipping action due to workflow validation: Workflow validation failed. The workflow file must exist and have identical content to the version on the repository's default branch. If you're seeing this on a PR when you first add a code review workflow file to your repository, this is normal and you should ignore this error.
Action skipped due to workflow validation error. This is expected when adding Claude Code workflows to new repositories or on PRs with workflow changes. If you're seeing this, your workflow will begin working once you merge your PR.

chatgptに聞いてみた

要点:先に.github/workflows/xxx.ymlをmainへ入れる。その後のPRではエラーが消え、通常通り動きます。

結論

ご提示いただいたメッセージはGitHubの設計仕様に由来しており、その根拠は公式ドキュメントとコミュニティ情報にしっかり記載されています。
したがって、以下のような対処手順が最善です:
	1.	.github/workflows/your-workflow.yml をまずデフォルトブランチ(mainなど)へマージしてください。
	2.	その後、内容を編集した新たなPRを出せば、エラー無しで実行されるようになります。

もしさらに詳しいリファレンスや、別の状況(たとえば workflow_dispatch や pull_request_target の関係など)での説明が必要でしたら、お気軽にお知らせください。

解決

mainブランチではなくstagingブランチで主に開発を進めていたので、workflowファイルは確かにmainブランチには存在していなかった

なので .githubディレクトリだけをそのままmainブランチに追加してpush、その後改めてPRを出し直したところ、無事ワークフローが動いた

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?