-
-
Notifications
You must be signed in to change notification settings - Fork 54
Add support for private repos using env var or netrc #78
Conversation
126e301
to
c8b3a23
Compare
The test is failing because the API is rate limited unless you authenticate, and there's a lot of tests running in quick succession. So it might be useful to authenticate on CI for this reason. You're allowed 60 requests per hour unauthenticated (per IP address) and 5000 requests per hour authenticated. |
Since our cli repo is still private, I had to use a forked `godownloader`. PR to merge back upstream: goreleaser/godownloader#78
I'll take a look at this later today. |
@@ -25,6 +25,49 @@ | |||
] | |||
revision = "ff0f66940b829dc66c81dad34746d4349b83eb9e" | |||
|
|||
[[projects]] | |||
name = "github.com/aws/aws-sdk-go" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change seems unrelated...
@@ -205,10 +204,11 @@ adjust_arch | |||
log_info "found version: ${VERSION} for ${TAG}/${OS}/${ARCH}" | |||
|
|||
{{ .Archive.NameTemplate }} | |||
GITHUB_DOWNLOAD=https://api.github.com/repos/${OWNER}/${REPO}/releases/tags/${TAG} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will hit rate limits on travis & cia...
I'm not sure... we were not using the API on purpose to avoid rate limit errors on OSS projects... maybe @client9 can give a better opinion... |
Yeah, that's my main concern as well. I don't think there's a way to support private repos without hitting the API endpoints though. |
Stale pull request message |
Would a flag be helpful?
|
@polothy I think that makes sense... |
@caarlos0 so can we do this? Can you wrap this up with the We'd still need this to fully do the homebrew with a private github repo, even if we have goreleaser/goreleaser#507, right? (I noticed that #69 was closed. 😢 ) |
Please see #161 |
This pull-request seems be stale, will auto-close soon. |
This adds support for using goreleaser against a private github repo. It authenticates using a personal access token. This token must have
repo
permissions to read the private repo. Note: this works for 2FA enabled as well.It checks for either a
GITHUB_TOKEN
env var or theapi.github.com
machine in your~/.netrc
file. This supports the token in both thepassword
or thelogin
field of the github machine.For example, both of these will work:
I also updated the
goreleaser
version sogodownloader
supportsgcflags
,asmflags
, and similar configuration.Now you can do something like this:
You're still able to shorten the URL but the header is required. So you might just wrap that in another bash script just to add the header. Create a public gist with the following contents:
Now create a short URL pointing to your public gist. Your users still get a nice short one-liner like
Fixes #69