mirror of
https://github.com/tj-actions/changed-files
synced 2025-03-06 05:17:44 +00:00
fix: fetching history for pr made from a fork with checkout set to the target repository (#1007)
This commit is contained in:
parent
89c8821949
commit
5ce975c602
1 changed files with 8 additions and 2 deletions
|
@ -188,8 +188,14 @@ else
|
||||||
|
|
||||||
if [[ "$IS_SHALLOW" == "true" ]]; then
|
if [[ "$IS_SHALLOW" == "true" ]]; then
|
||||||
echo "Fetching remote refs..."
|
echo "Fetching remote refs..."
|
||||||
|
|
||||||
|
if [[ "$GITHUB_EVENT_HEAD_REPO_FORK" != "true" ]]; then
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
git fetch $EXTRA_ARGS -u --progress origin pull/"$GITHUB_EVENT_PULL_REQUEST_NUMBER"/head:"$CURRENT_BRANCH" 1>/dev/null
|
git fetch $EXTRA_ARGS -u --progress origin pull/"$GITHUB_EVENT_PULL_REQUEST_NUMBER"/head:"$CURRENT_BRANCH" 1>/dev/null
|
||||||
|
else
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
git fetch $EXTRA_ARGS -u --progress origin "+refs/heads/$TARGET_BRANCH:refs/remotes/origin/$TARGET_BRANCH" "+refs/heads/$CURRENT_BRANCH*:refs/remotes/origin/$CURRENT_BRANCH*" 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$INPUT_SINCE_LAST_REMOTE_COMMIT" != "true" ]]; then
|
if [[ "$INPUT_SINCE_LAST_REMOTE_COMMIT" != "true" ]]; then
|
||||||
echo "::debug::Fetching remote target branch..."
|
echo "::debug::Fetching remote target branch..."
|
||||||
|
|
Loading…
Add table
Reference in a new issue