Use GITHUB_ENV to append to PATH

This commit is contained in:
Shivam Mathur 2021-01-07 21:53:45 +05:30
parent 068c794af7
commit d2f58713aa
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A

View File

@ -204,8 +204,10 @@ add_tool() {
tool=$2
ver_param=$3
tool_path="$tool_path_dir/$tool"
export PATH=$PATH:$tool_path_dir
echo "$tool_path_dir" >> "$GITHUB_PATH"
if ! [[ "$PATH" =~ $tool_path_dir ]] ; then
export PATH=$PATH:"$tool_path_dir"
echo "export PATH=\$PATH:$tool_path_dir" | sudo tee -a "$GITHUB_ENV" >/dev/null
fi
if [ ! -e "$tool_path" ]; then
rm -rf "$tool_path"
fi