Merge pull request #157 from zimbatm/default-token

Fix rate-limits by using github.token by default
This commit is contained in:
Domen Kožar 2023-02-05 18:35:04 +01:00 committed by GitHub
commit 67388ca69e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -26,3 +26,4 @@ runs:
INPUT_INSTALL_OPTIONS: ${{ inputs.install_options }} INPUT_INSTALL_OPTIONS: ${{ inputs.install_options }}
INPUT_INSTALL_URL: ${{ inputs.install_url }} INPUT_INSTALL_URL: ${{ inputs.install_url }}
INPUT_NIX_PATH: ${{ inputs.nix_path }} INPUT_NIX_PATH: ${{ inputs.nix_path }}
GITHUB_TOKEN: ${{ github.token }}

View File

@ -22,8 +22,10 @@ add_config "max-jobs = auto"
# Allow binary caches for user # Allow binary caches for user
add_config "trusted-users = root $USER" add_config "trusted-users = root $USER"
# Add github access token # 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" add_config "access-tokens = github.com=$INPUT_GITHUB_ACCESS_TOKEN"
elif [[ -n "${GITHUB_TOKEN:-}" ]]; then
add_config "access-tokens = github.com=$GITHUB_TOKEN"
fi fi
# Append extra nix configuration if provided # Append extra nix configuration if provided
if [[ $INPUT_EXTRA_NIX_CONFIG != "" ]]; then if [[ $INPUT_EXTRA_NIX_CONFIG != "" ]]; then