-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (39 loc) · 1.25 KB
/
pre-commit.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
40
41
42
43
44
45
name: pre-commit.ci
on:
workflow_dispatch:
inputs:
go_version:
description: "The go version to use"
required: false
go_version_file:
description: "The path to the go version file"
required: true
default: "go.mod"
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: actions/setup-go@v5
if: ${{ inputs.go_version_file }} == ''
with:
go-version: ${{ inputs.go_version }}
- uses: actions/setup-go@v5
if: ${{ inputs.go_version_file }} != ''
with:
go-version-file: ${{ inputs.go_version_file }}
- name: Install go toolchain for pre-commit
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.60.3
go install mvdan.cc/gofumpt@latest
- uses: pre-commit/action@v3.0.1
with:
extra_args: -a
- uses: pre-commit-ci/lite-action@v1.1.0
if: always()
with:
msg: |
chore(deps): [pre-commit.ci] auto fixes\n\nFor more information, see https://pre-commit.ci