From 8cfecdaabaa95cf5e7c61003c40c23ebe61c9550 Mon Sep 17 00:00:00 2001 From: Blair Hamilton Date: Fri, 3 Jul 2026 12:52:51 -0400 Subject: [PATCH] feat(action): add install-only input MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lets workflows that drive pre-commit themselves (diff-scoped runs, install-hooks cache seeding, custom log capture) use the action purely to install the binary onto PATH. Default false — behavior unchanged. --- action.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/action.yml b/action.yml index d2e4530..2c0fa20 100644 --- a/action.yml +++ b/action.yml @@ -21,6 +21,13 @@ inputs: description: Cache hook environments (~/.cache/pre-commit) between runs. required: false default: 'true' + install-only: + description: >- + Install the binary onto PATH (and optionally cache) but skip the + `pre-commit run` step. For workflows that drive pre-commit themselves + (diff-scoped runs, `install-hooks` cache seeding, custom log capture). + required: false + default: 'false' runs: using: composite @@ -89,5 +96,6 @@ runs: key: go-pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }} - name: Run pre-commit + if: inputs.install-only != 'true' shell: bash run: pre-commit run --show-diff-on-failure --color=always ${{ inputs.extra_args }}