mirror of
https://github.com/tj-actions/changed-files
synced 2024-12-16 19:27:39 +00:00
Updated git fetch to pull the last remote commit (#254)
* Update entrypoint.sh * Update entrypoint.sh * Update entrypoint.sh * Update entrypoint.sh * Update entrypoint.sh * Update entrypoint.sh
This commit is contained in:
parent
bb40edd264
commit
467d26c8b7
1 changed files with 4 additions and 1 deletions
|
@ -62,15 +62,18 @@ if [[ -z $GITHUB_BASE_REF ]]; then
|
|||
else
|
||||
TARGET_BRANCH=$GITHUB_BASE_REF
|
||||
CURRENT_BRANCH=$GITHUB_HEAD_REF
|
||||
git fetch temp_changed_files --no-tags -u "${TARGET_BRANCH}":"${TARGET_BRANCH}"
|
||||
|
||||
if [[ -z $INPUT_BASE_SHA ]]; then
|
||||
git fetch --no-tags -u --progress --depth=1 temp_changed_files "${TARGET_BRANCH}":"${TARGET_BRANCH}"
|
||||
PREVIOUS_SHA=$(git rev-parse "${TARGET_BRANCH}" 2>&1) && exit_status=$? || exit_status=$?
|
||||
else
|
||||
git fetch --no-tags -u --progress --depth=1 temp_changed_files "$INPUT_BASE_SHA"
|
||||
PREVIOUS_SHA=$INPUT_BASE_SHA
|
||||
fi
|
||||
|
||||
if [[ $exit_status -ne 0 ]]; then
|
||||
echo "::warning::Unable to determine the base ref sha for ${TARGET_BRANCH}"
|
||||
echo "::warning::You seem to be missing 'fetch-depth: 0' or 'fetch-depth: 2'. See https://github.com/tj-actions/changed-files#usage"
|
||||
git remote remove temp_changed_files
|
||||
exit 1
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue