-
Notifications
You must be signed in to change notification settings - Fork 6
47 lines (41 loc) · 1.27 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
46
47
name: Pre-commit Checks
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
pre-commit-hooks:
runs-on: ubuntu-latest
steps:
- name: Checkout Code Repository
uses: actions/checkout@v4
# Required to run the local ESLint hook
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: "22.x"
- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Dependencies
run: |
cd frontend
yarn install --frozen-lockfile
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
# Run all pre-commit hooks on all the files.
# Getting only staged files can be tricky in case a new PR is opened
# since the action is run on a branch in detached head state
- name: Install and Run Pre-commit
uses: pre-commit/[email protected]