@@ -16,35 +16,32 @@ jobs:
1616 - name : Checkout
1717 uses : actions/checkout@v4
1818 with :
19- fetch-depth : 0
2019 token : ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
2120
2221 - name : Configure Git
2322 run : |
2423 git config --global user.name AztecBot
2524 git config --global user.email tech@aztecprotocol.com
2625
27- - name : Create new merge-queue PR
26+ - name : Create new merge-train PR
2827 env :
2928 GH_TOKEN : ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
3029 run : |
3130 # The merge-train branch is the PR’s *head* branch (e.g. merge-train/main)
3231 MERGE_TRAIN_BRANCH="${{ github.event.pull_request.head.ref }}"
32+ BASE_BRANCH="${{ github.event.pull_request.base.ref }}"
3333
34- # Make sure we have it locally
35- git fetch origin "$MERGE_TRAIN_BRANCH":"$MERGE_TRAIN_BRANCH"
36- git checkout "$MERGE_TRAIN_BRANCH"
34+ # Make sure a merge commit gets into master.
35+ git fetch origin "$BASE_BRANCH"
36+ git checkout "$BASE_BRANCH"
37+ git merge -X ours "$MERGE_TRAIN_BRANCH" -m "Merge $MERGE_TRAIN_BRANCH history."
38+ git push origin "$BASE_BRANCH"
3739
38- # Spin up a fresh queue branch
39- TIMESTAMP=$(date +%Y%m%d-%H%M%S)
40- NEW_BRANCH="merge-queue/${MERGE_TRAIN_BRANCH}/${TIMESTAMP}"
41- git checkout -b "$NEW_BRANCH"
40+ git fetch origin "$MERGE_TRAIN_BRANCH" || true
41+ git checkout "$MERGE_TRAIN_BRANCH" || git checkout -b "$MERGE_TRAIN_BRANCH"
42+ git reset --hard "$BASE_BRANCH"
4243
43- # Merge the base branch (typically 'next') with theirs strategy
44- BASE_BRANCH="${MERGE_TRAIN_BRANCH#merge-train/}"
45- git merge -X theirs "origin/$BASE_BRANCH"
46-
47- # Seed it with an empty commit
44+ # Start with an empty commit
4845 git commit --allow-empty -m "[empty] Start merge-train. Choo choo."
4946
5047 # Push & open the PR
5451 --base "$MERGE_TRAIN_BRANCH" \
5552 --head "$NEW_BRANCH" \
5653 --title "feat : $MERGE_TRAIN_BRANCH" \
57- --body "This is an automated merge-queue PR. New commits from \`next\` will be added here.
58-
59- When ready, this PR will be merged automatically."
54+ --body "This is an automated merge-train PR with no commits."
0 commit comments