-
-
Notifications
You must be signed in to change notification settings - Fork 140
39 lines (37 loc) · 1.18 KB
/
dependabot_pr.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
name: dependabot_pr
on:
pull_request_target:
branches: [master]
paths:
- '**/go.mod'
- '**/go.sum'
jobs:
go-mod-tidy:
name: Update Go modules
if: contains(github.head_ref, 'dependabot/go_modules/') && github.event.pull_request.user.login == 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 2
token: ${{ secrets.PAT }}
- uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: Run prepare-release script to update Go modules
run: |
./devscripts/prepare-release
- name: Get last commit message
id: last-commit-message
run: |
echo "msg=$(git log -1 --pretty=%s)" >> $GITHUB_OUTPUT
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: ${{ github.event.workflow_run.head_branch }}
file_pattern: '**/go.mod **/go.sum'
commit_message: ${{ steps.last-commit-message.outputs.msg }}
commit_options: '--amend --no-edit'
push_options: '--force'
skip_fetch: true