Skip to content

Commit 97a1be3

Browse files
committed
fix: don't use the default GitHub token for Enterprise
The token on Enterprise instances is not valid for github.com. Resolves #196.
1 parent 300721f commit 97a1be3

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

install-nix.sh

+9-2
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,18 @@ if [[ $OSTYPE =~ darwin ]]; then
2525
fi
2626
# Allow binary caches for user
2727
add_config "trusted-users = root ${USER:-}"
28-
# Add github access token
28+
# Add a GitHub access token.
29+
# Token-less access is subject to lower rate limits.
2930
if [[ -n "${INPUT_GITHUB_ACCESS_TOKEN:-}" ]]; then
31+
echo "::debug::Using the provided github_access_token for github.com"
3032
add_config "access-tokens = github.com=$INPUT_GITHUB_ACCESS_TOKEN"
31-
elif [[ -n "${GITHUB_TOKEN:-}" ]]; then
33+
# Use the default GitHub token if available.
34+
# Skip this step if running an Enterprise instance. The default token there does not work for github.com.
35+
elif [[ -n "${GITHUB_TOKEN:-}" && $GITHUB_SERVER_URL == "https://github.com" ]]; then
36+
echo "::debug::Using the default GITHUB_TOKEN for github.com"
3237
add_config "access-tokens = github.com=$GITHUB_TOKEN"
38+
else
39+
echo "::debug::Continuing without a GitHub access token"
3340
fi
3441
# Append extra nix configuration if provided
3542
if [[ -n "${INPUT_EXTRA_NIX_CONFIG:-}" ]]; then

0 commit comments

Comments
 (0)