Skip to content

Commit

Permalink
Fix rate-limits by using github.token by default
Browse files Browse the repository at this point in the history
Turns out there is a default github token we can use to talk to github
and avoid the rate limit issues.
  • Loading branch information
zimbatm committed Feb 5, 2023
1 parent 25d64bb commit a4b8aaf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ runs:
INPUT_INSTALL_OPTIONS: ${{ inputs.install_options }}
INPUT_INSTALL_URL: ${{ inputs.install_url }}
INPUT_NIX_PATH: ${{ inputs.nix_path }}
GITHUB_TOKEN: ${{ github.token }}
4 changes: 3 additions & 1 deletion install-nix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ add_config "max-jobs = auto"
# Allow binary caches for user
add_config "trusted-users = root $USER"
# Add github access token
if [[ $INPUT_GITHUB_ACCESS_TOKEN != "" ]]; then
if [[ -n "${INPUT_GITHUB_ACCESS_TOKEN:-}" ]]; then
add_config "access-tokens = github.com=$INPUT_GITHUB_ACCESS_TOKEN"
elif [[ -n "${GITHUB_TOKEN:-}" ]]; then
add_config "access-tokens = github.com=$GITHUB_TOKEN"
fi
# Append extra nix configuration if provided
if [[ $INPUT_EXTRA_NIX_CONFIG != "" ]]; then
Expand Down

0 comments on commit a4b8aaf

Please sign in to comment.