diff --git a/src/scripts/common.sh b/src/scripts/common.sh index 655c9670..db3f17f2 100644 --- a/src/scripts/common.sh +++ b/src/scripts/common.sh @@ -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