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: |