From b80d9cca04dec461b7ff6cdec99e1b07a31c8750 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Tue, 17 Aug 2021 20:03:07 -0400 Subject: [PATCH] Fix persisting origin URL (#159) --- entrypoint.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 64727a60..324ce8da 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,7 +4,7 @@ set -e echo "::group::changed-files" -git remote set-url origin "https://${INPUT_TOKEN}@github.com/${GITHUB_REPOSITORY}" +git remote add temp_changed_files "https://${INPUT_TOKEN}@github.com/${GITHUB_REPOSITORY}" echo "Getting HEAD info..." @@ -36,7 +36,7 @@ if [[ -z $GITHUB_BASE_REF ]]; then else TARGET_BRANCH=$GITHUB_BASE_REF CURRENT_BRANCH=$GITHUB_HEAD_REF - git fetch origin "${TARGET_BRANCH}":"${TARGET_BRANCH}" + git fetch temp_changed_files "${TARGET_BRANCH}":"${TARGET_BRANCH}" if [[ -z $INPUT_BASE_SHA ]]; then PREVIOUS_SHA=$(git rev-parse "${TARGET_BRANCH}" 2>&1) && exit_status=$? || exit_status=$? else @@ -162,6 +162,8 @@ if [[ -n "$UNIQUE_FILES" ]]; then fi +git remote remove temp_changed_files + echo "::set-output name=added_files::$ADDED" echo "::set-output name=copied_files::$COPIED" echo "::set-output name=deleted_files::$DELETED"