File tree Expand file tree Collapse file tree 2 files changed +16
-40
lines changed Expand file tree Collapse file tree 2 files changed +16
-40
lines changed Original file line number Diff line number Diff line change 11name : dependabot_pr
22
33on :
4- pull_request :
4+ pull_request_target :
55 branches : [master]
66 paths :
77 - ' **/go.mod'
88 - ' **/go.sum'
99
1010jobs :
1111 go-mod-tidy :
12+ name : Update Go modules
1213 if : contains(github.head_ref, 'dependabot/go_modules/') && github.event.pull_request.user.login == 'dependabot[bot]'
1314 runs-on : ubuntu-latest
1415 steps :
1516 - uses : actions/checkout@v3
1617 with :
17- ref : ${{ github.event.pull_request.head.sha }}
18+ ref : ${{ github.head_ref }}
19+ fetch-depth : 2
20+ token : ${{ secrets.PAT }}
1821 - uses : actions/setup-go@v3
1922 with :
2023 go-version : 1.17
2124 - name : Run prepare-release script to update Go modules
2225 run : |
2326 ./devscripts/prepare-release
24- - name : Create diff artifact
27+ - name : Get last commit message
28+ id : last-commit-message
2529 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
2833 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