Pull requests from forks of your private repository are failing at the checkout step with an error message as shown below.
ERROR: Repository not found. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. Exited with code 128
Solution
Check the "Advanced Settings" of the "Project Settings" to see if the "Pass secrets to builds from forked pull requests" setting is enabled.
In order for pull requests from forks of a private repository to build, the checkout key for the parent repository is required to be shared, and hence the "Pass secrets to builds from forked pull requests" setting would need to be enabled.
For more information, visit this blog post about triggering trusted CI jobs on untrusted forks.
Warning: There are serious security concerns with the "Pass secrets to builds from forked pull requests" setting (see the documentation for details.) If you have SSH keys, sensitive env vars or AWS credentials stored in your project settings and untrusted forks can make pull requests against your repo, then this option isn't for you!
Comments
Article is closed for comments.