fix: error fetching history for PR branches (#1015)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
6961203862
commit
84ed30e2f4
56
.github/workflows/test.yml
vendored
56
.github/workflows/test.yml
vendored
@ -5,10 +5,6 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- "**"
|
- "**"
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
pull_request_review:
|
pull_request_review:
|
||||||
@ -28,12 +24,7 @@ jobs:
|
|||||||
|
|
||||||
test-multiple-repositories:
|
test-multiple-repositories:
|
||||||
name: Test with multiple repositories
|
name: Test with multiple repositories
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
max-parallel: 2
|
|
||||||
matrix:
|
|
||||||
platform: [ubuntu-latest]
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout into dir1
|
- name: Checkout into dir1
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@ -84,13 +75,8 @@ jobs:
|
|||||||
|
|
||||||
test-using-since-and-until:
|
test-using-since-and-until:
|
||||||
name: Test changed-files using since and until
|
name: Test changed-files using since and until
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ubuntu-latest
|
||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
max-parallel: 2
|
|
||||||
matrix:
|
|
||||||
platform: [ubuntu-latest]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout to branch
|
- name: Checkout to branch
|
||||||
@ -140,12 +126,7 @@ jobs:
|
|||||||
|
|
||||||
test-similar-base-and-commit-sha:
|
test-similar-base-and-commit-sha:
|
||||||
name: Test changed-files similar base and commit sha
|
name: Test changed-files similar base and commit sha
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
max-parallel: 4
|
|
||||||
matrix:
|
|
||||||
platform: [ubuntu-latest]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout to branch
|
- name: Checkout to branch
|
||||||
@ -175,12 +156,7 @@ jobs:
|
|||||||
|
|
||||||
test-unset-github-output-env:
|
test-unset-github-output-env:
|
||||||
name: Test unset GITHUB_OUTPUT env
|
name: Test unset GITHUB_OUTPUT env
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
max-parallel: 4
|
|
||||||
matrix:
|
|
||||||
platform: [ubuntu-latest]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout to branch
|
- name: Checkout to branch
|
||||||
@ -203,12 +179,11 @@ jobs:
|
|||||||
|
|
||||||
test-limited-commit-history:
|
test-limited-commit-history:
|
||||||
name: Test changed-files with limited commit history
|
name: Test changed-files with limited commit history
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
max-parallel: 4
|
max-parallel: 4
|
||||||
matrix:
|
matrix:
|
||||||
platform: [ubuntu-latest]
|
|
||||||
fetch-depth: [1, 2]
|
fetch-depth: [1, 2]
|
||||||
input-fetch_depth: [1, 50]
|
input-fetch_depth: [1, 50]
|
||||||
|
|
||||||
@ -232,12 +207,7 @@ jobs:
|
|||||||
|
|
||||||
test-non-existent-base-sha:
|
test-non-existent-base-sha:
|
||||||
name: Test changed-files non existent base sha
|
name: Test changed-files non existent base sha
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
max-parallel: 4
|
|
||||||
matrix:
|
|
||||||
platform: [ubuntu-latest]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout to branch
|
- name: Checkout to branch
|
||||||
@ -284,12 +254,7 @@ jobs:
|
|||||||
|
|
||||||
test-non-existent-sha:
|
test-non-existent-sha:
|
||||||
name: Test changed-files non existent sha
|
name: Test changed-files non existent sha
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
max-parallel: 4
|
|
||||||
matrix:
|
|
||||||
platform: [ubuntu-latest]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout to branch
|
- name: Checkout to branch
|
||||||
@ -336,13 +301,12 @@ jobs:
|
|||||||
|
|
||||||
test-submodules:
|
test-submodules:
|
||||||
name: Test changed-files with submodule
|
name: Test changed-files with submodule
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
max-parallel: 4
|
max-parallel: 4
|
||||||
matrix:
|
matrix:
|
||||||
platform: [ubuntu-latest]
|
fetch-depth: [0, 1, 2]
|
||||||
fetch-depth: [0, 1]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout to branch
|
- name: Checkout to branch
|
||||||
@ -380,7 +344,7 @@ jobs:
|
|||||||
max-parallel: 4
|
max-parallel: 4
|
||||||
matrix:
|
matrix:
|
||||||
platform: [ubuntu-latest, ubuntu-22.04, windows-latest, macos-latest, macos-11, windows-2022]
|
platform: [ubuntu-latest, ubuntu-22.04, windows-latest, macos-latest, macos-11, windows-2022]
|
||||||
fetch-depth: [0, 1]
|
fetch-depth: [0, 1, 2]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
@ -189,12 +189,13 @@ 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
|
if git fetch $EXTRA_ARGS -u --progress origin pull/"$GITHUB_EVENT_PULL_REQUEST_NUMBER"/head:"$CURRENT_BRANCH" 1>/dev/null; then
|
||||||
|
echo "First fetch succeeded"
|
||||||
else
|
else
|
||||||
|
echo "First fetch failed, falling back to second fetch"
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH" origin +refs/heads/"$CURRENT_BRANCH"*:refs/remotes/origin/"$CURRENT_BRANCH"* 1>/dev/null
|
git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH" origin +refs/heads/"$CURRENT_BRANCH"*:refs/remotes/origin/"$CURRENT_BRANCH"* 1>/dev/null || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$INPUT_SINCE_LAST_REMOTE_COMMIT" != "true" ]]; then
|
if [[ "$INPUT_SINCE_LAST_REMOTE_COMMIT" != "true" ]]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user