0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

CodePipelineからGitHubリポジトリを参照する際に「リポジトリが見つからない」場合のトラブルシューティング

Last updated at Posted at 2024-01-11

はじめに

CodePipelineからCodeStarを利用しGitHub接続をする検証中に、ハマった点について紹介します。

前提

  • CodePipelineでは、CodeStarSourceConnection(デベロッパー用ツール > 設定 > 接続)を用いて、各種プロバイダーと接続が可能です。
  • 接続設定がされていると、CodePipeline上の「リポジトリ名」「ブランチ名」の指定を元に、ソースコード取得が可能です。
  • 今回の記事では、CodeStarSourceConnectionの接続設定自体についての解説は行いません。

参考:CodeStarSourceConnection for Bitbucket Cloud, GitHub, GitHub Enterprise Server, GitLab.com, and GitLab self-managed actions

発生した事象

  • GitHub上にリポジトリやブランチが実在するにも関わらず、CodePipeline上でFullRepositoryNameが見つけられないと表示される

[GitHub] No Branch [main] found for FullRepositoryName [yoyoyo-pg/gradle-publish-sample]

image.png

原因

  • 以前、GitHub側にインストールしていたAWS Connectorを使いまわしており、今回のパイプラインの対象リポジトリに対するアクセス権限が存在しませんでした。
  • こちらの設定に関しては、GitHubのユーザーページ > settings > Integrations > Applications から確認可能です。

github-auth.png

対処法

  • 対象のリポジトリを新たに加え、saveします。

select-repo.png

  • パイプラインを再実行し、無事GitHubからのソース取得に成功しました!

cicd.png

ついでに検証

  • CodeStarSourceConnectionについてのドキュメントに記載がありますが、リポジトリ名に関しては大文字小文字を正しく設定する必要があるようです。
  • 今回だとyoyoyo-pg/gradle-publish-sampleという指定ですが、あえてYOYOYO-PG/Gradle-Publish-Sampleという指定で記載し、パイプラインを動かしてみました。
  • ただし、こちらに関してはエラーとなる事無くソース取得に成功しました。
0
1
1

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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?