name: 'set up pre-commit environment'

runs:
  using: "composite"
  steps:
    - uses: ./.github/workflows/auto-cache
      with:
        path: .ci_cache/pre-commit
        key: pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }}
        restore-keys: |
          pre-commit-
        save: ${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'commaai/openpilot' }}
