name: Pre-commit # Runs the repo-wide lint/format/secret checks via `task pre-commit`. # Called from build.yml on PRs and merge_group; also runnable on demand via workflow_dispatch. on: workflow_call: workflow_dispatch: permissions: contents: read jobs: pre-commit: runs-on: ubuntu-latest steps: - name: Harden Runner uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0 with: egress-policy: audit - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 0 persist-credentials: false - name: Install uv uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 with: enable-cache: true cache-dependency-glob: | engine/pyproject.toml engine/uv.lock cache-suffix: pre-commit - name: Install Task uses: go-task/setup-task@01a4adf9db2d14c1de7a560f09170b6e0df736aa # v2.1.0 - name: Run pre-commit checks run: task pre-commit # The fixture corpus checks the comment rules themselves, so it runs here # rather than on every local commit. - name: Check the comment-lint fixture corpus run: task pre-commit:comment-lint:selftest