Compare commits

..

3 Commits

Author SHA1 Message Date
Domen Kožar
a56e3a8089
Merge pull request #199 from jalaziz/tempdir
fix: Set TMPDIR to avoid disk space issues
2023-11-04 12:09:00 +00:00
Jameel Al-Aziz
81eb746179
Update install-nix.sh
Co-authored-by: Domen Kožar <domen@enlambda.com>
2023-11-03 12:58:15 -07:00
Jameel Al-Aziz
2cce1fd76b
fix: Set TMPDIR to avoid disk space issues
Set `TMPDIR` if not already set to workaround potential disk space
issues while running builds in a nix shell. See NixOS/nix#395 for
more info.

fixes #197
2023-11-02 18:38:07 -07:00

View File

@ -25,18 +25,11 @@ if [[ $OSTYPE =~ darwin ]]; then
fi
# Allow binary caches for user
add_config "trusted-users = root ${USER:-}"
# Add a GitHub access token.
# Token-less access is subject to lower rate limits.
# Add github access token
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"
# 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"
elif [[ -n "${GITHUB_TOKEN:-}" ]]; then
add_config "access-tokens = github.com=$GITHUB_TOKEN"
else
echo "::debug::Continuing without a GitHub access token"
fi
# Append extra nix configuration if provided
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"
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
echo "::endgroup::"