Skip to content

Commit bffa781

Browse files
ludamadjohnathan79717AztecBotledwards2225
authored
feat: merge-train/barretenberg (#15336)
Co-authored-by: Jonathan Hao <jonathan@aztec-labs.com> Co-authored-by: AztecBot <tech@aztecprotocol.com> Co-authored-by: ledwards2225 <98505400+ledwards2225@users.noreply.github.com>
1 parent bf5d93a commit bffa781

1 file changed

Lines changed: 12 additions & 17 deletions

File tree

.github/workflows/merge-train-recreate.yml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -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
@@ -54,6 +51,4 @@ jobs:
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

Comments
 (0)