-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (50 loc) · 1.58 KB
/
Copy pathpre-commit.yaml
File metadata and controls
58 lines (50 loc) · 1.58 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
---
name: pre-commit checks
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
branches:
- main
jobs:
pre-commit:
name: Run pre-commit
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Generate Token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
id: app-token
with:
client-id: ${{ secrets.GHAPP_APP_ID }}
private-key: ${{ secrets.GHAPP_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
token: '${{ steps.app-token.outputs.token }}'
- name: Set up Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: '3.14'
- name: Cache pre-commit hooks
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
pre-commit-${{ runner.os }}-
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.48.0
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files --color=always --show-diff-on-failure