-
Notifications
You must be signed in to change notification settings - Fork 0
27 lines (26 loc) · 1020 Bytes
/
pre-commit-hooks.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
name: Pre-commit hooks
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
# We're basically using the same steps as here - https://github.com/pre-commit/action/blob/main/action.yml
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: "stable"
- run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: ~/.cache/pre-commit
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- run: python -m pip install pre-commit
- run: pre-commit run --all-files --show-diff-on-failure --color=always
shell: bash