3
0
Fork 0
mirror of https://github.com/tj-actions/changed-files synced 2024-12-17 13:47:20 +00:00

Fix persisting origin URL (#159)

This commit is contained in:
Tonye Jack 2021-08-17 20:03:07 -04:00 committed by GitHub
parent 2f8c46f9d7
commit b80d9cca04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"