Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Repository not found or permission denied" when creating AWS Codebuild Repository

We are trying to create a codebuild in aws and have a private github repository in github, while creating the codebuild section i am getting the Repository not found or permission denied error after clicking on create button in code build section.

has someone came across this issue, if so can you please suggest.

Thanks in Advance.

like image 523
vinod Avatar asked Nov 27 '19 12:11

vinod


People also ask

How do I link AWS CodeBuild to GitHub?

Connect GitHub with an access token (console)For Source provider, choose GitHub. For Repository, choose Connect with a GitHub personal access token. In GitHub personal access token, enter your GitHub personal access token. Choose Save token.

What is CodeBuild Webhook?

A webhook triggers a build when the path of a changed file matches the regular expressions pattern. A FILE_PATH filter can be used with GitHub push and pull request events and GitHub Enterprise Server push events. It cannot be used with GitHub Enterprise Server pull request events.

Where does AWS CodeBuild run your builds?

AWS CodeBuild runs your builds in preconfigured build environments that contain the operating system, programming language runtime, and build tools (e.g., Apache Maven, Gradle, npm) required to complete the task.


2 Answers

I had this issue because I was using a low-privilege account to access GitHub. CodeBuild needs admin access to the repository in order to create webhooks, so the solution for me was to grant the user admin access to the repo in question (via GitHub, in the repo's Settings page), create the CodeBuild project, then set the user back to read-only.

like image 52
Malvineous Avatar answered Sep 17 '22 22:09

Malvineous


Try:

CodeBuild > {project} > Sources > Disconnect from GitHub, then Reconnect with a GitHub account where your code repository is.

CodeBuild can only hold one GitHub authentication per account per region.

like image 41
shariqmaws Avatar answered Sep 20 '22 22:09

shariqmaws