name: pre-commit on: pull_request: branches: [main] workflow_call: concurrency: group: pre-commit-${{ github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} permissions: contents: read jobs: pre-commit: if: github.event.pull_request.draft != true runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: "3.12" - run: echo "::add-matcher::.github/workflows/matchers/actionlint.json" - run: echo "::add-matcher::.github/workflows/matchers/mypy.json" - run: echo "::add-matcher::.github/workflows/matchers/ruff.json" - uses: pre-commit/action@v3.0.1 with: extra_args: --all-files --hook-stage manual