Search code examples
gitgocirclecigo-packages

I'm unable to clone from multiple repos on CircleCi


I'm unable to download my newly released go package from CircleCi. Locally it works. I'm able to verify that the tag I'm trying to use is available by visiting https://github.com/acme/my-lib/tree/v0.0.3

However, go get will not download it.

I have GOPRIVATE=github.com/acme/ I've also tried with github.com/acme/* also, the same result.

Running go get returns this

go: finding github.com/acme/my-lib v0.0.3
go: github.com/acme/[email protected]: unknown revision v0.0.3
go: error loading module requirements

go.mod

module github.com/acme/project

require (
          github.com/acme/my-lib v0.0.3
)

Why doesn't go recognize my tagged release when running from CircleCi`

I have also tried changing my .git/config:

[remote "origin"]
        # url = [email protected]:acme/my-lib.git
        url = https://github.com/acme/my-lib.git

Neither https or ssh works.

git ls-remote from desktop

git ls-remote https://github.com/acme/my-lib | ack v0.0.3
$SHA        refs/tags/v0.0.3

git ls-remote from circleci

git ls-remote https://github.com/acme/my-lib | grep v0.0.3
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Solution

  • You need to configure Circle CI to be able to read additional private repositories: https://circleci.com/docs/2.0/gh-bb-integration/#enable-your-project-to-check-out-additional-private-repositories ?

    To be able to create reproducible builds, have you considered vendoring in /acme/project: https://tip.golang.org/cmd/go/#hdr-Modules_and_vendoring ?