Install into $RUNNER_TEMP instead of $HOME#338
Merged
Conversation
$HOME can change between composite-action steps on some runners (e.g. self-hosted ones where actions/checkout temporarily overrides it), which makes the PATH entry from the setup step point at a different directory than the install step writes to. The result is 'lychee: command not found' even though install reported success. $RUNNER_TEMP is guaranteed-writable and stable across steps within a job, which is exactly what we need here. Fixes lycheeverse#337
With $RUNNER_TEMP the install directory is fresh per job, and 'install -t' overwrites existing files by default, so the explicit 'rm -f' step is no longer doing anything useful.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I can already see how this'll be super problematic downstream, but here we go… 😅
$HOMEis evaluated in two separate composite-action shells ("Set up environment" adds$HOME/.local/binto PATH, "Install lychee" later installs there). On runners where$HOMEdiffers between steps — e.g. self-hosted ones whereactions/checkoutoverrides it — those two paths diverge and the next step exits withlychee: command not found.This swaps
$HOME/.local/binfor$RUNNER_TEMP/lychee/bin. Same shape, but the path doesn't move between steps. Also gracefully handles containers where$HOMEmight be unset.Fixes #337.