-
Notifications
You must be signed in to change notification settings - Fork 64
54 lines (48 loc) · 1.56 KB
/
merge-branches.yaml
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
53
54
name: merge-customize-branches
on:
push:
branches:
- master
permissions:
contents: write
jobs:
merge-branches:
strategy:
matrix:
# if a new branch needs to be rebased onto, add its name here
branch: [tap, xd, dc, tap-intl]
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup git
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Rebase and push
run: |
git switch "${{ matrix.branch }}"
git rebase master
git push --force-with-lease
- name: Report failure
uses: slackapi/[email protected]
if: ${{ failure() }}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
channel-id: ${{ vars.SLACK_NOTIFY_CHANNEL }}
payload: |
{
"text": "Github Action failed when rebasing master to branch ${{ matrix.branch }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Github Action failed when rebasing <${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|master> to branch <${{ github.server_url }}/${{ github.repository }}/tree/${{ matrix.branch }}|${{ matrix.branch }}>"
}
}
]
}