---
name: Pre Commit
on:
  pull_request:
  merge_group:
    types: [checks_requested]


jobs:
  pre-commit:
    name: Pre Commit Hooks
    runs-on: ubuntu-latest
    container: ghcr.io/rpm-software-management/dnf-ci-host
    steps:
    - uses: actions/checkout@v4
    - name: Install pre-commit
      run: pip install pre-commit
    - name: State to use Workspace Dir
      run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
    - name: Run pre-commit on entire codebase
      run: pre-commit run --show-diff-on-failure --color=always --all-files
