From 5b87ab7d26955f7ceea20a096a220a88dd7b8086 Mon Sep 17 00:00:00 2001 From: Lucas Prates Date: Wed, 8 Jan 2025 14:44:26 +0000 Subject: [PATCH] [automerge] Use 'git fetch --unshallow' instead of fetching all branches This updates the automerge workflow to use the `git fetch --unshallow` command instead of using fetching the entire history during the workflow's initial checkout. The latter, beyond too slow, doesn't create the local branch references required by the automerge script. --- .github/workflows/automerge.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index a0f49955f2ea..89a11e11f8fb 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -18,12 +18,16 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: - # Fetch entire repository history - fetch-depth: 0 + ref: ${{ env.TO_BRANCH }} - name: Configure Git Identity run: | git config --local user.name "github-actions[bot]" git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + - name: Fetch Branches + run: | + git remote set-branches --add origin ${{ env.FROM_BRANCH }} + git fetch origin ${{ env.FROM_BRANCH }}:${{ env.FROM_BRANCH }} + git fetch origin --update-head-ok --unshallow ${{ env.TO_BRANCH }}:${{ env.TO_BRANCH }} - name: Run automerge run: python3 arm-software/ci/automerge.py --project-name ${{ github.repository }} --from-branch ${{ env.FROM_BRANCH }} --to-branch ${{ env.TO_BRANCH }} env: