File tree Expand file tree Collapse file tree 3 files changed +65
-70
lines changed Expand file tree Collapse file tree 3 files changed +65
-70
lines changed Original file line number Diff line number Diff line change
1
+ name : Dependabot Auto Build
2
+ on : pull_request_target
3
+
4
+ permissions :
5
+ pull-requests : write
6
+ contents : write
7
+
8
+ jobs :
9
+ metadata :
10
+ runs-on : ubuntu-latest
11
+ outputs :
12
+ dependency-names : ${{ steps.metadata.outputs.dependency-names }}
13
+ steps :
14
+ - name : Dependabot metadata
15
+ uses : Xuanwo/fetch-metadata@v1.2.2
16
+ id : metadata
17
+ with :
18
+ github-token : " ${{ secrets.GITHUB_TOKEN }}"
19
+
20
+ dependabot :
21
+ needs : metadata
22
+ if : ${{ needs.metadata.outputs.dependency-names != '' }}
23
+ runs-on : ubuntu-latest
24
+ steps :
25
+ - name : Set up Go 1.x
26
+ uses : actions/setup-go@v2
27
+ with :
28
+ go-version : " 1.16"
29
+
30
+ - name : Checkout repository
31
+ uses : actions/checkout@v2
32
+ with :
33
+ ref : ${{ github.head_ref }}
34
+ token : ${{ secrets.ROBOT_GITHUB_TOKEN }}
35
+
36
+ - name : Auto build
37
+ run : make build
38
+
39
+ - name : Auto commit
40
+ uses : stefanzweifel/git-auto-commit-action@v4
41
+ if : ${{contains(needs.metadata.outputs.dependency-names, 'github.com/beyondstorage/go-storage/v4')}}
42
+ with :
43
+ commit_message : Auto build to generate code
44
+
45
+ - name : Auto merge
46
+ run : gh pr merge --auto --squash "$PR_URL"
47
+ env :
48
+ PR_URL : ${{ github.event.pull_request.html_url }}
49
+ GITHUB_TOKEN : ${{ secrets.ROBOT_GITHUB_TOKEN }}
50
+
51
+ - name : Auto approve
52
+ run : gh pr review "$PR_URL" -a
53
+ env :
54
+ PR_URL : ${{ github.event.pull_request.html_url }}
55
+ GITHUB_TOKEN : ${{ secrets.ROBOT_GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1
- name : " gofmt "
1
+ name : " Build Test "
2
2
3
3
on : [ push,pull_request ]
4
4
5
5
jobs :
6
- gofmt :
7
- name : gofmt
6
+ build_test :
7
+ name : Build Test
8
8
runs-on : ubuntu-latest
9
9
10
10
steps :
11
11
- name : Set up Go 1.x
12
12
uses : actions/setup-go@v2
13
13
with :
14
- go-version : " 1.15 "
14
+ go-version : " 1.16 "
15
15
16
16
- name : Checkout repository
17
17
uses : actions/checkout@v2
18
18
19
19
- name : Format
20
20
run : if [ "$(gofmt -l . | wc -l)" -gt 0 ]; then exit 1; fi
21
+
22
+ - name : Build
23
+ run : make build
24
+
25
+ - name : Git Diff
26
+ run : if [ "$(git diff | wc -l)" -gt 0 ]; then exit 1; fi
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments