/ .github / workflows / pre-commit.yaml
pre-commit.yaml
 1  name: Pre-commit checks
 2  
 3  on:
 4    pull_request:
 5      branches:
 6        - '**'
 7    push: 
 8      branches: 
 9        - '**'
10            
11  jobs:
12    pre-commit-check:
13      runs-on: ubuntu-latest
14      environment: pre-commit
15      steps:
16      - name: Checkout Source Code
17        uses: actions/checkout@v2
18  
19      - name: Setup Python
20        uses: actions/setup-python@v2
21        with:
22          python-version: '3.9.17'
23          
24      - name: Install pre-commit
25        run: pip install pre-commit
26        
27      - name: Initialize pre-commit
28        run: pre-commit install
29        
30      - name: Run pre-commit hooks
31        run: pre-commit run --all-files