-
-
Notifications
You must be signed in to change notification settings - Fork 10
66 lines (57 loc) · 1.72 KB
/
pr-tidy.yaml
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
55
56
57
58
59
60
61
62
63
64
65
66
---
name: pr-tidy
on:
pull_request_target:
env:
GO111MODULE: "on"
GO_VERSION: 1.20.x
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
tidy:
runs-on: ubuntu-latest
if: ${{ startsWith(github.head_ref, 'dependabot/go_modules/') }}
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.PUSH_TOKEN }}
ref: ${{ github.head_ref }}
- name: Go cache
uses: actions/cache@v3
with:
# In order:
# * Module download cache
# * Build cache (Linux)
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ env.GO_VERSION }}-cache-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ env.GO_VERSION }}-cache
- name: Tidy
run: |
make tidy
- name: setup-gpg
id: setup-gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.PUSH_PRIVATE_KEY }}
passphrase: ${{ secrets.PUSH_SECRET }}
git_config_global: true
git_user_signingkey: true
git_commit_gpgsign: true
git_tag_gpgsign: false
- uses: EndBug/add-and-commit@v9
with:
message: "go mod tidy"
push: true
author_name: ${{ steps.setup-gpg.outputs.name }}
author_email: ${{ steps.setup-gpg.outputs.email }}
committer_name: ${{ steps.setup-gpg.outputs.name }}
committer_email: ${{ steps.setup-gpg.outputs.email }}