简体   繁体   中英

Clone github enterprise private repo in CodeBuild

I'm setting up a CICD pipeline using AWS CodePipeline and CodeBuild which gets triggered from a private Github Enterprise repo.

I need access to this repo in the build step of my pipeline, so I'm cloning it using a command like this in my buildspec.yml file:

git clone https://<user>:<token>@github.ent.companydomain.com/xxx/xxx.git

This is giving me a 403 Forbidden error even though the repo exists and the URL is correct. How do I clone my repo in build step?

Try to add git-credential-helper: yes inside env of your buildspec.yml file.

Also check whether you have provided proper access token if you are using github as source provider and authorised it via AWS console

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM