|
| 1 | +--- |
1 | 2 | # This action is centrally managed in https://github.com/<organization>/.github/
|
2 | 3 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
3 | 4 | # the above-mentioned repo.
|
4 | 5 |
|
| 6 | +# This workflow will, first, automatically approve PRs created by @LizardByte-bot. Then it will automerge relevant PRs. |
| 7 | + |
5 | 8 | name: Automerge PR
|
6 | 9 |
|
7 | 10 | on:
|
|
10 | 13 | - opened
|
11 | 14 | - synchronize
|
12 | 15 |
|
| 16 | +concurrency: |
| 17 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 18 | + cancel-in-progress: true |
| 19 | + |
13 | 20 | jobs:
|
14 | 21 | autoapprove:
|
15 |
| - if: > |
| 22 | + if: >- |
16 | 23 | contains(fromJson('["LizardByte-bot"]'), github.event.pull_request.user.login) &&
|
17 |
| - contains(fromJson('["LizardByte-bot"]'), github.actor) |
| 24 | + contains(fromJson('["LizardByte-bot"]'), github.actor) && |
| 25 | + startsWith(github.repository, 'LizardByte/') |
18 | 26 | runs-on: ubuntu-latest
|
19 | 27 | steps:
|
20 |
| - - name: Autoapproving |
21 |
| - uses: hmarr/auto-approve-action@v2 |
22 |
| - with: |
23 |
| - github-token: "${{ secrets.GITHUB_TOKEN }}" |
24 |
| - |
25 |
| - - name: Label autoapproved |
26 |
| - uses: actions/github-script@v5 |
27 |
| - with: |
28 |
| - github-token: ${{ secrets.GH_BOT_TOKEN }} |
29 |
| - script: | |
30 |
| - github.rest.issues.addLabels({ |
31 |
| - issue_number: context.issue.number, |
32 |
| - owner: context.repo.owner, |
33 |
| - repo: context.repo.repo, |
34 |
| - labels: ['autoapproved', 'autoupdate'] |
35 |
| - }) |
| 28 | + - name: Autoapproving |
| 29 | + uses: hmarr/auto-approve-action@v3 |
| 30 | + with: |
| 31 | + github-token: "${{ secrets.GITHUB_TOKEN }}" |
| 32 | + |
| 33 | + - name: Label autoapproved |
| 34 | + uses: actions/github-script@v6 |
| 35 | + with: |
| 36 | + github-token: ${{ secrets.GH_BOT_TOKEN }} |
| 37 | + script: | |
| 38 | + github.rest.issues.addLabels({ |
| 39 | + issue_number: context.issue.number, |
| 40 | + owner: context.repo.owner, |
| 41 | + repo: context.repo.repo, |
| 42 | + labels: ['autoapproved', 'autoupdate'] |
| 43 | + }) |
36 | 44 |
|
37 | 45 | automerge:
|
| 46 | + if: startsWith(github.repository, 'LizardByte/') |
38 | 47 | needs: [autoapprove]
|
39 | 48 | runs-on: ubuntu-latest
|
40 |
| - concurrency: |
41 |
| - group: automerge-${{ github.ref }} |
42 |
| - cancel-in-progress: true |
43 | 49 |
|
44 | 50 | steps:
|
45 | 51 | - name: Automerging
|
46 |
| - uses: pascalgn/[email protected].3 |
| 52 | + uses: pascalgn/[email protected].5 |
47 | 53 | env:
|
48 | 54 | BASE_BRANCHES: nightly
|
49 | 55 | GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
|
50 | 56 | GITHUB_LOGIN: ${{ secrets.GH_BOT_NAME }}
|
51 |
| - MERGE_LABELS: "" |
| 57 | + MERGE_LABELS: "!dependencies" |
52 | 58 | MERGE_METHOD: "squash"
|
53 | 59 | MERGE_COMMIT_MESSAGE: "{pullRequest.title} (#{pullRequest.number})"
|
54 | 60 | MERGE_DELETE_BRANCH: true
|
|
0 commit comments