Skip to content

Commit 253f603

Browse files
committed
Add pre-commit GitHub Action
Signed-off-by: Anish Asthana <anishasthana1@gmail.com>
1 parent f02f046 commit 253f603

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/precommit.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Pre-commit
2+
on:
3+
push:
4+
branches:
5+
- '**'
6+
tags-ignore:
7+
- 'v*'
8+
pull_request:
9+
workflow_dispatch:
10+
11+
jobs:
12+
precommit:
13+
runs-on: ubuntu-latest
14+
container:
15+
image: quay.io/opendatahub/pre-commit-go-toolchain:v0.2 # https://github.com/opendatahub-io/data-science-pipelines-operator/blob/main/.github
16+
env:
17+
XDG_CACHE_HOME: /cache
18+
GOCACHE: /cache/go-build
19+
GOMODCACHE: /cache/go-mod
20+
PRE_COMMIT_HOME: /cache/pre-commit
21+
volumes:
22+
- /cache
23+
steps:
24+
- uses: actions/checkout@v2
25+
26+
- name: Activate cache
27+
uses: actions/cache@v2
28+
with:
29+
path: /cache
30+
key: ${{ runner.os }}-cache-${{ hashFiles('**/go.sum', '.pre-commit-config.yaml') }}
31+
32+
- name: Run pre-commit checks
33+
run: pre-commit run --all-files

0 commit comments

Comments
 (0)