From e81cb010f8d68ef7317f66ae727e52098f8ae1ab Mon Sep 17 00:00:00 2001 From: Yih-Dar <2521628+ydshieh@users.noreply.github.com> Date: Wed, 12 Oct 2022 09:25:05 +0200 Subject: [PATCH] Avoid Push CI failing to report due to many commits being merged (#19496) * Change the depth to 20 * Add comment Co-authored-by: ydshieh --- .github/workflows/self-push.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/self-push.yml b/.github/workflows/self-push.yml index e64b32270e..6abe3498cd 100644 --- a/.github/workflows/self-push.yml +++ b/.github/workflows/self-push.yml @@ -526,6 +526,11 @@ jobs: echo "env.CI_SHA = ${{ env.CI_SHA }}" - uses: actions/checkout@v2 + # To avoid failure when multiple commits are merged into `main` in a short period of time. + # Checking out to an old commit beyond the fetch depth will get an error `fatal: reference is not a tree: ... + # (Only required for `workflow_run` event, where we get the latest HEAD on `main` instead of the event commit) + with: + fetch-depth: 20 - name: Update clone using environment variables run: |