File tree 2 files changed +16
-40
lines changed
2 files changed +16
-40
lines changed Original file line number Diff line number Diff line change 1
1
name : dependabot_pr
2
2
3
3
on :
4
- pull_request :
4
+ pull_request_target :
5
5
branches : [master]
6
6
paths :
7
7
- ' **/go.mod'
8
8
- ' **/go.sum'
9
9
10
10
jobs :
11
11
go-mod-tidy :
12
+ name : Update Go modules
12
13
if : contains(github.head_ref, 'dependabot/go_modules/') && github.event.pull_request.user.login == 'dependabot[bot]'
13
14
runs-on : ubuntu-latest
14
15
steps :
15
16
- uses : actions/checkout@v3
16
17
with :
17
- ref : ${{ github.event.pull_request.head.sha }}
18
+ ref : ${{ github.head_ref }}
19
+ fetch-depth : 2
20
+ token : ${{ secrets.PAT }}
18
21
- uses : actions/setup-go@v3
19
22
with :
20
23
go-version : 1.17
21
24
- name : Run prepare-release script to update Go modules
22
25
run : |
23
26
./devscripts/prepare-release
24
- - name : Create diff artifact
27
+ - name : Get last commit message
28
+ id : last-commit-message
25
29
run : |
26
- git diff > /tmp/diff
27
- - uses : actions/upload-artifact@v2
30
+ echo "msg=$(git log -1 --pretty=%s)" >> $GITHUB_OUTPUT
31
+ - name : Commit changes
32
+ uses : stefanzweifel/git-auto-commit-action@v4
28
33
with :
29
- name : diff
30
- path : /tmp/diff
31
- retention-days : 1
34
+ branch : ${{ github.event.workflow_run.head_branch }}
35
+ file_pattern : ' **/go.mod **/go.sum'
36
+ commit_message : ${{ steps.last-commit-message.outputs.msg }}
37
+ commit_options : ' --amend --no-edit'
38
+ push_options : ' --force'
39
+ skip_fetch : true
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments