optionally authenticate against github api during install #1337
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When running in a CI environment we sometimes experience rate limiting from the GitHub API when trying to run direnv's install.sh. This causes the whole build to fail, which can be frustrating.
The Homebrew project has previously worked around a similar issue by allowing the user to optionally authenticate using their personal GitHub account, which results in a higher rate limit on API usage. (See
HOMEBREW_GITHU_API_TOKEN
docs here: https://docs.brew.sh/Manpage).This PR introduces a similar optional environment variable for direnv's install.sh script, which will allow us to inject a dedicated authentication token into our CI builds and avoid spurious failures.
I wasn't sure if you'd want a note added in
docs/installation.md
- please just let me know if you would and I'll add it.The only other thing that I'm just noticing is that it seems that the convention in this script is for lower case environment variables as inputs - would you like me to change that?