Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
a56e3a8089 | ||
|
81eb746179 | ||
|
2cce1fd76b |
@ -25,18 +25,11 @@ 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 a GitHub access token.
|
# Add 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"
|
||||||
# Use the default GitHub token if available.
|
elif [[ -n "${GITHUB_TOKEN:-}" ]]; then
|
||||||
# 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
|
||||||
@ -98,5 +91,10 @@ if [[ -n "${INPUT_NIX_PATH:-}" ]]; then
|
|||||||
echo "NIX_PATH=${INPUT_NIX_PATH}" >> "$GITHUB_ENV"
|
echo "NIX_PATH=${INPUT_NIX_PATH}" >> "$GITHUB_ENV"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Set temporary directory (if not already set) to fix https://github.com/cachix/install-nix-action/issues/197
|
||||||
|
if [[ -z "${TMPDIR:-}" ]]; then
|
||||||
|
echo "TMPDIR=${RUNNER_TEMP}" >> "$GITHUB_ENV"
|
||||||
|
fi
|
||||||
|
|
||||||
# Close the log message group which was opened above
|
# Close the log message group which was opened above
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
Loading…
Reference in New Issue
Block a user