Running on CI can trigger bash: line 39: GITHUB_PATH: unbound variable error
mjpieters opened this issue · 1 comments
mjpieters commented
When running on a CI environment other than Github, using the install-from-binstall-release.sh
script but forgetting to include the $CARGO_HOME/bin
path in the PATH
env var, leads to this error:
bash: line 39: GITHUB_PATH: unbound variable
That's because the set -u
bash option is enabled in the script, and GITHUB_PATH
is not a variable you can expect to exist on other CI environments.
This can be trivially fixed by using ${GITHUB_PATH:-}
instead, which will substitute the empty string if the variable is null. test -n
then still exits with 1, achieving the same test result.
NobodyXu commented
Thanks!
I would fix it soon, but I also welcome contributions from community, so if you have a PR I would merge it.