-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (32 loc) · 1.07 KB
/
_pre-commit-check.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
28
29
30
31
32
33
34
35
36
37
38
name: Pre-Commit Check
on:
pull_request:
jobs:
pre-commit-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pre-commit
- name: Check if pre-commit ran locally
run: |
# if git rev-parse --verify ${{ github.ref }} >/dev/null 2>&1; then
# # if git rev-parse --verify HEAD >/dev/null 2>&1; then
# echo "Checking if pre-commit ran locally..."
# if [ -f .pre_commit_ran ]; then
# echo "Pre-commit checks were run locally."
# else
# echo "Pre-commit checks were not run locally. Please run 'pre-commit run --all-files' before pushing."
# exit 1
# fi
# else
# echo "This is not a push to a branch. Skipping pre-commit check."
# fi
pre-commit run