mirror of
https://github.com/tj-actions/changed-files
synced 2025-01-17 19:17:45 +00:00
fix: bug with invalid branch name
This commit is contained in:
parent
77f03d2bb5
commit
9962dc418e
1 changed files with 3 additions and 4 deletions
|
@ -45,8 +45,6 @@ fi
|
|||
|
||||
if [[ -z $GITHUB_BASE_REF ]]; then
|
||||
echo "Running on a push event..."
|
||||
TARGET_BRANCH=${GITHUB_REF/refs\/heads\//} && exit_status=$? || exit_status=$?
|
||||
CURRENT_BRANCH=$TARGET_BRANCH && exit_status=$? || exit_status=$?
|
||||
|
||||
echo "::debug::Getting HEAD SHA..."
|
||||
if [[ -n "$INPUT_UNTIL" ]]; then
|
||||
|
@ -67,6 +65,9 @@ if [[ -z $GITHUB_BASE_REF ]]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
TARGET_BRANCH=$(git name-rev --name-only "$CURRENT_SHA" 2>&1) && exit_status=$? || exit_status=$?
|
||||
CURRENT_BRANCH=$TARGET_BRANCH && exit_status=$? || exit_status=$?
|
||||
|
||||
echo "::debug::Verifying the current commit SHA: $CURRENT_SHA"
|
||||
git rev-parse --quiet --verify "$CURRENT_SHA^{commit}" 1>/dev/null 2>&1 && exit_status=$? || exit_status=$?
|
||||
|
||||
|
@ -127,8 +128,6 @@ if [[ -z $GITHUB_BASE_REF ]]; then
|
|||
# shellcheck disable=SC2086
|
||||
git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH"
|
||||
PREVIOUS_SHA=$INPUT_BASE_SHA
|
||||
TARGET_BRANCH=$(git name-rev --name-only "$PREVIOUS_SHA" 2>&1) && exit_status=$? || exit_status=$?
|
||||
CURRENT_BRANCH=$TARGET_BRANCH
|
||||
fi
|
||||
|
||||
echo "::debug::Target branch $TARGET_BRANCH..."
|
||||
|
|
Loading…
Reference in a new issue