Skip to content

Setup pre-commit and ruff #4

Setup pre-commit and ruff

Setup pre-commit and ruff #4

Workflow file for this run

name: Pre-commit Check
on: pull_request
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install pre-commit
run: pip install pre-commit
- name: Get changed files
id: changed-files
run: |
echo "files=$(git diff --name-only origin/main...HEAD | tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Run pre-commit
continue-on-error: true
run: |
pre-commit run --files ${{ steps.changed-files.outputs.files }}