-
Notifications
You must be signed in to change notification settings - Fork 8
44 lines (37 loc) · 1.09 KB
/
pre-commit.yml
File metadata and controls
44 lines (37 loc) · 1.09 KB
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
---
# yamllint disable rule:comments
# yamllint disable rule:truthy
name: Pre-commit Code Quality Checks
on:
pull_request:
types:
- opened
- synchronize
- reopened
branches:
- main
push:
branches:
- main
permissions:
contents: read
jobs:
run-pre-commit:
runs-on: ubuntu-latest
timeout-minutes: 60
container:
image: ghcr.io/${{ github.repository }}-pre-commit:main
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Cache Pre-commit
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/.cache/pre-commit/
key: pre-commit|${{ github.repository }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Mark repository as safe
shell: bash
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Run pre-commit in all files
shell: bash
run: pre-commit run --show-diff-on-failure --color=always --all-files | tee pre-commit.log