Merge 97a1be3c09645647090b7f312d24568f1b5ef1ef into a56e3a80896f10bfe28feea2c49695c0225b2485

This commit is contained in:
Sander 2023-11-06 10:46:06 +00:00 committed by GitHub
commit 16ce83eba0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,11 +25,18 @@ if [[ $OSTYPE =~ darwin ]]; then
fi fi
# 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 a GitHub access token.
# Token-less access is subject to lower rate limits.
if [[ -n "${INPUT_GITHUB_ACCESS_TOKEN:-}" ]]; then if [[ -n "${INPUT_GITHUB_ACCESS_TOKEN:-}" ]]; then
echo "::debug::Using the provided github_access_token for github.com"
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 # Use the default GitHub token if available.
# Skip this step if running an Enterprise instance. The default token there does not work for github.com.
elif [[ -n "${GITHUB_TOKEN:-}" && $GITHUB_SERVER_URL == "https://github.com" ]]; then
echo "::debug::Using the default GITHUB_TOKEN for github.com"
add_config "access-tokens = github.com=$GITHUB_TOKEN" add_config "access-tokens = github.com=$GITHUB_TOKEN"
else
echo "::debug::Continuing without a GitHub access token"
fi fi
# Append extra nix configuration if provided # Append extra nix configuration if provided
if [[ -n "${INPUT_EXTRA_NIX_CONFIG:-}" ]]; then if [[ -n "${INPUT_EXTRA_NIX_CONFIG:-}" ]]; then