feat(hooks): add Unity Git Hooks integration and runHookGroups

Built-in support for Unity Git Hooks (com.frostebite.unitygithooks):
- Auto-detect UPM package in Packages/manifest.json
- Run init-unity-lefthook.js before hook installation
- Set CI-friendly env vars (disable background project mode)

New gitHooksRunBeforeBuild input runs specific lefthook groups before
the Unity build, allowing CI to trigger pre-commit or pre-push checks
that normally only fire on git events.

35 unit tests covering detection, init, CI env, group execution, and
failure handling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
frostebite
2026-03-05 08:54:07 +00:00
parent cf3478c8ec
commit 26903e96dd
5 changed files with 445 additions and 20 deletions
+8
View File
@@ -345,6 +345,14 @@ inputs:
default: ''
description:
'Comma-separated list of hook names to skip even when gitHooksEnabled is true. Example: pre-push,post-merge'
gitHooksRunBeforeBuild:
required: false
default: ''
description:
'Comma-separated list of lefthook hook groups to run before the Unity build. Allows CI to
trigger checks that normally only run on git events. Example: pre-commit,pre-push. Requires
lefthook. Works with Unity Git Hooks (com.frostebite.unitygithooks) when installed as a UPM
package — the init script runs automatically.'
providerExecutable:
required: false
default: ''