Skip to content

Commit 4af3579

Browse files
authored
[automerge] Use 'git fetch --unshallow' instead of fetching all branches (#20)
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.
1 parent b7e359a commit 4af3579

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/automerge.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@ jobs:
1818
- name: Checkout
1919
uses: actions/checkout@v4
2020
with:
21-
# Fetch entire repository history
22-
fetch-depth: 0
21+
ref: ${{ env.TO_BRANCH }}
2322
- name: Configure Git Identity
2423
run: |
2524
git config --local user.name "github-actions[bot]"
2625
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
26+
- name: Fetch Branches
27+
run: |
28+
git remote set-branches --add origin ${{ env.FROM_BRANCH }}
29+
git fetch origin ${{ env.FROM_BRANCH }}:${{ env.FROM_BRANCH }}
30+
git fetch origin --update-head-ok --unshallow ${{ env.TO_BRANCH }}:${{ env.TO_BRANCH }}
2731
- name: Run automerge
2832
run: python3 arm-software/ci/automerge.py --project-name ${{ github.repository }} --from-branch ${{ env.FROM_BRANCH }} --to-branch ${{ env.TO_BRANCH }}
2933
env:

0 commit comments

Comments
 (0)