mirror of
https://github.com/tj-actions/changed-files
synced 2025-02-21 05:28:14 +00:00
feat: add support for closed pull requests with merge true
Closes: #635
This commit is contained in:
parent
0144a27348
commit
7939ced35e
1 changed files with 2 additions and 11 deletions
13
diff-sha.sh
13
diff-sha.sh
|
@ -96,18 +96,9 @@ else
|
|||
echo "::debug::GITHUB_BASE_REF: $TARGET_BRANCH..."
|
||||
|
||||
if [[ -z $INPUT_BASE_SHA ]]; then
|
||||
if [[ "$INPUT_USE_FORK_POINT" == "true" ]]; then
|
||||
echo "::debug::Getting fork point..."
|
||||
git fetch --no-tags -u --progress origin "${TARGET_BRANCH}":"${TARGET_BRANCH}" && exit_status=$? || exit_status=$?
|
||||
PREVIOUS_SHA=$(git merge-base --fork-point "${TARGET_BRANCH}" "$(git name-rev --name-only "$CURRENT_SHA")") && exit_status=$? || exit_status=$?
|
||||
echo "::debug::Previous SHA: $PREVIOUS_SHA"
|
||||
else
|
||||
git fetch --no-tags -u --progress origin --depth=1 "${TARGET_BRANCH}":"${TARGET_BRANCH}" && exit_status=$? || exit_status=$?
|
||||
PREVIOUS_SHA=$(git rev-list -n 1 "${TARGET_BRANCH}" 2>&1) && exit_status=$? || exit_status=$?
|
||||
echo "::debug::Previous SHA: $PREVIOUS_SHA"
|
||||
fi
|
||||
PREVIOUS_SHA=$GITHUB_PULL_REQUEST_BASE_SHA && exit_status=$? || exit_status=$?
|
||||
echo "::debug::Previous SHA: $PREVIOUS_SHA"
|
||||
else
|
||||
git fetch --no-tags -u --progress origin --depth=1 "$(git rev-parse --verify "$INPUT_BASE_SHA")" && exit_status=$? || exit_status=$?
|
||||
PREVIOUS_SHA=$INPUT_BASE_SHA
|
||||
TARGET_BRANCH=$(git name-rev --name-only "$PREVIOUS_SHA" 2>&1) && exit_status=$? || exit_status=$?
|
||||
echo "::debug::Previous SHA: $PREVIOUS_SHA"
|
||||
|
|
Loading…
Add table
Reference in a new issue