-
Notifications
You must be signed in to change notification settings - Fork 12
62 lines (54 loc) · 1.64 KB
/
automerge.yml
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
55
56
57
58
59
60
61
62
name: automerge
on:
workflow_call:
inputs:
branch:
required: true
type: string
outputs:
changed:
value: ${{ jobs.automerge.outputs.changed }}
basesha:
value: ${{ jobs.automerge.outputs.basesha }}
jobs:
automerge:
name: Automerge ${{ inputs.branch }}
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.rebase.outputs.changed }}
basesha: ${{ steps.rebase.outputs.basesha }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: topjohnwu/Magisk
submodules: 'recursive'
fetch-depth: 0
- name: Setup git
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Add remote
run: |
git remote add other https://github.com/$GITHUB_REPOSITORY.git
git fetch other
- name: Rebase changes
id: rebase
run: |
git checkout other/ci-management mergehelper.sh
chmod +x mergehelper.sh
./mergehelper.sh ${{ inputs.branch }}
rm -f mergehelper.sh
- name: Remove workflows
run: |
git restore --staged .
git rm -rf .github/workflows
git commit -m "remove workflows"
- name: Push result
if: steps.rebase.outputs.changed == 'true'
uses: ad-m/[email protected]
with:
force: true
branch: ci-build-${{ inputs.branch }}
github_token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}