From 03c25e7214a14f8c020b4c6bff7739d2008f2b5b Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Thu, 5 Nov 2026 00:26:20 +1100 Subject: [PATCH] docs(workflow): say repo.commit never runs the checkout's git hooks Refs #1792 --- WORKFLOWS.md | 9 +++++++++ internal/domain/workflow/repo_steps.go | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/WORKFLOWS.md b/WORKFLOWS.md index 46c5a2dda..66058557f 100644 --- a/WORKFLOWS.md +++ b/WORKFLOWS.md @@ -156,6 +156,15 @@ _needs a repository._ | `push` | bool | Push the branch after committing. | | `reference` | `Fixes` \| `Implements` \| `Refs` | How the commit links to the task issue. | +Hooks never run. The commit is created by go-git, which ignores `.git/hooks` +and `core.hooksPath`, and the agent never runs git, so `pre-commit`, +`commit-msg` and `prepare-commit-msg` in the checkout are inert files. A +repository whose rules live only in a hook — a formatter, a secret scanner, +commitlint, a DCO trailer — gets a commit that does not satisfy them: the run +reports success and the pull request fails the check afterwards. Put the same +commands in `command.run` or the repository gate, which both run in the task +container before this step. + ### `repo.open-pr` _needs a repository._ diff --git a/internal/domain/workflow/repo_steps.go b/internal/domain/workflow/repo_steps.go index e8579b854..6b7699cdd 100644 --- a/internal/domain/workflow/repo_steps.go +++ b/internal/domain/workflow/repo_steps.go @@ -113,7 +113,7 @@ func runRepoTooling(ctx context.Context, tc *TaskContext) error { } type repoCommitSettings struct { - Message string `yaml:"message" doc:"The commit message."` + Message string `yaml:"message" doc:"The commit message. Hooks in the checkout never run, so commit-message policy (commitlint, DCO) is not applied."` // Reference is the verb that links the commit to the task's issue // ("Fixes", "Implements", "Refs"); empty links nothing. Reference string `yaml:"reference" enum:"Fixes,Implements,Refs" doc:"How the commit links to the task issue."`