概要
AWS CodepipelineでGithub接続バージョン2を利用していたら以下のエラーになりました。こちらの解決方法を紹介します。
[GitHub] No Branch [xxx] found for FullRepositoryName [xxx/xxxx_xxx]
前提:CodePipeline設定
- Sourceのアクションプロバイダーは GitHub バージョン2 を利用
- Buildのアクションプロバイダーは AWSCodebuild を利用
- CodePipeline と GitHub の連携は CodeStarSourceConnection を使用
- Github側の AWS Connector for GitHub は以前からインストール済
原因と解決方法
エラーメッセージが「GitHubリポジトリの指定されたブランチを見つけることができない」と言っている通り、Githubとの連携に失敗しています。
Github側で該当リポジトリをAWS Connector for GitHubに登録していない場合、CodePipelineはリポジトリやそのブランチにアクセスできません。設定は以下から可能です。
https://github.com/organizations/xxxxx/settings/installations
Githubのsettings
からThird-party Access
のGitHub Apps
に行くと、AWS Connector for GitHubを更新できます(初めての場合はAWS側から飛んだ気がする)。ここに該当リポジトリを含めてあればOKです。
これで解決!