{"action":"closed","issue":{"url":"https://api.github.com/repos/travis-ci/travis-ci/issues/5418","repository_url":"https://api.github.com/repos/travis-ci/travis-ci","labels_url":"https://api.github.com/repos/travis-ci/travis-ci/issues/5418/labels{/name}","comments_url":"https://api.github.com/repos/travis-ci/travis-ci/issues/5418/comments","events_url":"https://api.github.com/repos/travis-ci/travis-ci/issues/5418/events","html_url":"https://github.com/travis-ci/travis-ci/issues/5418","id":125264089,"number":5418,"title":"Better workaround for golang private imports from github","user":{"login":"tomdionysus","id":1161952,"avatar_url":"https://avatars1.githubusercontent.com/u/1161952?v=4","gravatar_id":"","url":"https://api.github.com/users/tomdionysus","html_url":"https://github.com/tomdionysus","followers_url":"https://api.github.com/users/tomdionysus/followers","following_url":"https://api.github.com/users/tomdionysus/following{/other_user}","gists_url":"https://api.github.com/users/tomdionysus/gists{/gist_id}","starred_url":"https://api.github.com/users/tomdionysus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomdionysus/subscriptions","organizations_url":"https://api.github.com/users/tomdionysus/orgs","repos_url":"https://api.github.com/users/tomdionysus/repos","events_url":"https://api.github.com/users/tomdionysus/events{/privacy}","received_events_url":"https://api.github.com/users/tomdionysus/received_events","type":"User","site_admin":false},"labels":[{"id":899951296,"url":"https://api.github.com/repos/travis-ci/travis-ci/labels/stale","name":"stale","color":"ffffff","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-01-06T21:12:01Z","updated_at":"2018-04-15T05:25:08Z","closed_at":"2018-04-15T05:25:08Z","author_association":"NONE","body":"The documentation on [installing dependencies from private repositories in a golang project](https://docs.travis-ci.com/user/languages/go#Installing-Private-Dependencies) describes a workaround that requires adding usernames and tokens into the repo - although this works, there are obvious security problems with the approach.\n\nUsing [this article](https://michaelheap.com/golang-how-to-go-get-private-repos/) as a guide we managed to get this working without any tokens in the repo, by ensuring that the SSH key being used by Travis had access to the dependency repos and adding the following to `.travis.yml`:\n\n```\nbefore_install:\n  - git config --global url.\"git@github.com:\".insteadOf \"https://github.com/\"\n```\n\nThis causes `go get` to use SSH to clone the dependencies, removing the need for explicit token authentication to private repos in github.\n\nIf the community has similar success and agrees that this is a better approach, would it be possible to change the documentation to reflect this?\n"}}
{"actor":{"display_login":"stale"}}