-
Notifications
You must be signed in to change notification settings - Fork 80
35 lines (33 loc) · 972 Bytes
/
pre-commit.yml
File metadata and controls
35 lines (33 loc) · 972 Bytes
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
name: Pre-commit checks
on:
push:
pull_request:
workflow_call:
jobs:
pre-commit:
runs-on: ubuntu-24.04
container:
image: ghcr.io/learning-process/ppc-ubuntu:1.1
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v5
with:
submodules: recursive
fetch-depth: 0
- name: Setup environment
run: |
python3 -m pip install -r requirements.txt --break-system-packages --ignore-installed
- name: Configure git safe directory
run: |
git config --global --add safe.directory '*'
- name: Run pre-commit checks
run: |
FROM_REF="${{ github.base_ref }}"
if [ -n "$FROM_REF" ]; then
git fetch origin "$FROM_REF:$FROM_REF" || true
else
FROM_REF="HEAD~1"
fi
pre-commit run --from-ref "$FROM_REF" --to-ref HEAD