I'm trying to set up automated build for Go projects. We have some internal dependencies however available on our private BitBucket. Credentials are needed however to have go access these. I'm able to read the main repo using option Git and SSH but I'm able to download the dependencies from BitBucket.
I already tried with:
git config --global url."git@bitbucket.org:".insteadOf "https://bitbucket.org/"
export 'GOPRIVATE=bitbucket.org/*'
however this doesn't seem work, since the output:
+ go version
22:33:27 go version go1.16.4 darwin/arm64
+ go test
22:33:29 go: missing Mercurial command. See https://golang.org/s/gogetcmd
22:33:30 go: bitbucket.org/repositorie_url: reading https://api.bitbucket.org/2.0/repositorie_url/dependency_repo 403 Forbidden
22:33:30 server response: Access denied. You must have write or admin access.
How could I make sure go get or go install gets access to our private repository in a secure way?
NOTE: go test sems to ignore git configuration and it's trying to reach dependencies from https, in addition I have some Mercurial errors.