From 0d983b7678d662663079534063e97d00415650b3 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Tue, 26 Oct 2021 09:38:45 -0400 Subject: [PATCH] Resolved bug with already existing remote --- entrypoint.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 17ea7120fdf..e3a289510fe 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -17,7 +17,11 @@ fi SERVER_URL=$(echo "$GITHUB_SERVER_URL" | awk -F/ '{print $3}') -git remote add temp_changed_files "https://${INPUT_TOKEN}@${SERVER_URL}/${GITHUB_REPOSITORY}" +git ls-remote temp_changed_files 1>/dev/null 2>&1 && exit_status=$? || exit_status=$? + +if [[ $exit_status -ne 0 ]]; then + git remote add temp_changed_files "https://${INPUT_TOKEN}@${SERVER_URL}/${GITHUB_REPOSITORY}" +fi echo "Getting HEAD info..."