mirror of
https://github.com/tj-actions/changed-files
synced 2024-12-17 13:47:20 +00:00
chore: update the default sha (#896)
This commit is contained in:
parent
61648e78ea
commit
8a5f6280e6
2 changed files with 6 additions and 9 deletions
|
@ -46,7 +46,6 @@ inputs:
|
|||
sha:
|
||||
description: "Specify a different commit SHA used for comparing changes"
|
||||
required: false
|
||||
default: ${{ github.sha }}
|
||||
base_sha:
|
||||
description: "Specify a different base commit SHA used for comparing changes"
|
||||
required: false
|
||||
|
@ -174,6 +173,7 @@ runs:
|
|||
GITHUB_SERVER_URL: ${{ github.server_url }}
|
||||
GITHUB_REPOSITORY: ${{ github.repository }}
|
||||
GITHUB_REF: ${{ github.ref }}
|
||||
GITHUB_SHA: ${{ github.sha }}
|
||||
GITHUB_BASE_REF: ${{ github.base_ref }}
|
||||
GITHUB_HEAD_REF: ${{ github.head_ref }}
|
||||
GITHUB_WORKSPACE: ${{ github.workspace }}
|
||||
|
|
13
diff-sha.sh
13
diff-sha.sh
|
@ -55,6 +55,11 @@ if [[ -z $GITHUB_BASE_REF ]]; then
|
|||
TARGET_BRANCH=$GITHUB_REFNAME
|
||||
CURRENT_BRANCH=$TARGET_BRANCH
|
||||
|
||||
echo "Fetching remote refs..."
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH" origin "$CURRENT_BRANCH" 1>/dev/null 2>&1
|
||||
|
||||
echo "::debug::Getting HEAD SHA..."
|
||||
if [[ -n "$INPUT_UNTIL" ]]; then
|
||||
echo "::debug::Getting HEAD SHA for '$INPUT_UNTIL'..."
|
||||
|
@ -68,8 +73,6 @@ if [[ -z $GITHUB_BASE_REF ]]; then
|
|||
if [[ -z $INPUT_SHA ]]; then
|
||||
CURRENT_SHA=$(git rev-list -n 1 HEAD) && exit_status=$? || exit_status=$?
|
||||
else
|
||||
# shellcheck disable=SC2086
|
||||
git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH" origin "$CURRENT_BRANCH" 1>/dev/null 2>&1
|
||||
CURRENT_SHA=$INPUT_SHA; exit_status=$?
|
||||
fi
|
||||
fi
|
||||
|
@ -131,8 +134,6 @@ if [[ -z $GITHUB_BASE_REF ]]; then
|
|||
fi
|
||||
fi
|
||||
else
|
||||
# shellcheck disable=SC2086
|
||||
git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH" origin "$CURRENT_BRANCH" 1>/dev/null 2>&1
|
||||
PREVIOUS_SHA=$INPUT_BASE_SHA
|
||||
fi
|
||||
|
||||
|
@ -174,10 +175,6 @@ else
|
|||
CURRENT_SHA=$(git rev-list -n 1 HEAD) && exit_status=$? || exit_status=$?
|
||||
else
|
||||
CURRENT_SHA=$INPUT_SHA; exit_status=$?
|
||||
|
||||
if [[ "$CURRENT_SHA" == "$GITHUB_EVENT_PULL_REQUEST_HEAD_SHA" ]]; then
|
||||
CURRENT_SHA=$(git rev-list -n 1 HEAD) && exit_status=$? || exit_status=$?
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue