From d2f58713aaf7809d0c4d11e827c9e9dbbc55b34e Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 7 Jan 2021 21:53:45 +0530 Subject: [PATCH] Use GITHUB_ENV to append to PATH --- src/scripts/common.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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