-
Notifications
You must be signed in to change notification settings - Fork 56
54 lines (46 loc) · 1.4 KB
/
auto-merge.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
name: Dependabot Auto Build
on: pull_request_target
permissions:
pull-requests: write
contents: write
jobs:
metadata:
runs-on: ubuntu-latest
outputs:
dependency-names: ${{ steps.metadata.outputs.dependency-names }}
steps:
- name: Dependabot metadata
uses: Xuanwo/fetch-metadata@v1.2.2
id: metadata
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
dependabot:
needs: metadata
if: ${{ needs.metadata.outputs.dependency-names != '' }}
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: "1.17"
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.ROBOT_GITHUB_TOKEN }}
- name: Auto build
run: make build
- name: Auto commit
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Auto build to generate code
- name: Auto merge
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.ROBOT_GITHUB_TOKEN }}
- name: Auto approve
run: gh pr review "$PR_URL" -a
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.ROBOT_GITHUB_TOKEN }}