diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 4728c17..194c672 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -12,7 +12,15 @@ jobs: run: pipx install pre-commit - name: Run pre-commit - run: ~/.local/bin/pre-commit run --all-files --show-diff-on-failure + # `pipx install` writes the app to PIPX_BIN_DIR, which is not + # necessarily ~/.local/bin and not necessarily on PATH, so don't + # hardcode a path that only some runner images happen to use. + run: | + if command -v pre-commit >/dev/null 2>&1; then + pre-commit run --all-files --show-diff-on-failure + else + pipx run pre-commit run --all-files --show-diff-on-failure + fi build: strategy: