Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github releases API auth #101

Merged
merged 4 commits into from
Feb 27, 2023
Merged

Github releases API auth #101

merged 4 commits into from
Feb 27, 2023

Conversation

agouin
Copy link
Member

@agouin agouin commented Feb 27, 2023

Unauthenticated requests are limited to 60 requests per hour. This increases to 1000 per hour per repo for personal accounts, and 15000 for enterprise accounts.

Adds GH_USER and GH_PAT env vars to authenticate to Github API when fetching recent releases

Resolves #47

@agouin agouin force-pushed the andrew/race branch 2 times, most recently from b5b42f5 to 983b6e3 Compare February 27, 2023 16:15
@agouin agouin changed the base branch from andrew/race to main February 27, 2023 16:18
@@ -36,6 +38,11 @@ func mostRecentReleasesForChain(
return builder.HeighlinerQueuedChainBuilds{}, fmt.Errorf("error building github releases request: %v", err)
}

githubUser, githubPAT := os.Getenv("GH_USER"), os.Getenv("GH_PAT")
if githubUser != "" && githubPAT != "" {
req.Header.Add("Authorization", "Basic "+base64.StdEncoding.EncodeToString([]byte(githubUser+":"+githubPAT)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sleek.

Copy link
Contributor

@DavidNix DavidNix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@agouin agouin merged commit 2532c9c into main Feb 27, 2023
@agouin agouin deleted the andrew/basic_auth branch February 27, 2023 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Heighliner hits Github rate limits
3 participants