name: pre-commit

on:
  pull_request:
    branches: [main]
  push:
    branches: [main]
  workflow_dispatch: # for manual trigger

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

permissions:
  contents: read

jobs:
  pre-commit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: actions/setup-python@v6
        with:
          python-version: "3.12"
          cache: 'pip'
      - uses: pre-commit/action@v3.0.1
