-
Notifications
You must be signed in to change notification settings - Fork 38
52 lines (45 loc) · 1.74 KB
/
Copy pathback-merge.yml
File metadata and controls
52 lines (45 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Back-merge
# After a release on main, sync main back into next so its changelog, manifest,
# and version bumps do not drift. No conflict -> push next directly (the App is
# an "always" bypass actor on next). Conflict -> open a PR for a human.
on:
release:
types: [published]
concurrency:
group: back-merge
cancel-in-progress: false
permissions: {}
jobs:
back-merge:
name: Back-merge main into next
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
id: app-token
with:
app-id: ${{ secrets.AIDD_BOT_APP_ID }}
private-key: ${{ secrets.AIDD_BOT_PRIVATE_KEY }}
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: next
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
- name: Merge main into next
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
git config user.name "aidd-bot[bot]"
git config user.email "aidd-bot[bot]@users.noreply.github.com"
git fetch origin main
if git merge --no-edit origin/main; then
git push origin next
else
git merge --abort
BRANCH="back-merge/main-to-next-${{ github.run_id }}"
git checkout -b "$BRANCH" origin/main
git push origin "$BRANCH"
gh pr create --base next --head "$BRANCH" \
--title "chore: back-merge main into next (conflicts)" \
--body "Automated back-merge hit conflicts (CHANGELOG / manifest / version files). Resolve manually, then merge into next." \
--repo "${{ github.repository }}"
fi