mirror of
https://github.com/docker/docs.git
synced 2026-06-19 07:35:16 +00:00
b162a7a83a
The `PreToolUse:Bash` hook invoked `enforce-git-hygiene.sh` on every Bash tool call, even though the script only blocks `git add . / -A / --all`. Add `"if": "Bash(git add *)"` so the script only runs when the command actually contains `git add`.
28 lines
621 B
JSON
28 lines
621 B
JSON
{
|
|
"hooks": {
|
|
"PreToolUse": [
|
|
{
|
|
"matcher": "Edit|Write",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "bash .agents/hooks/enforce-vendored.sh"
|
|
}
|
|
],
|
|
"description": "Block edits to vendored content (_vendor/, data/cli/)"
|
|
},
|
|
{
|
|
"matcher": "Bash",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"if": "Bash(git add *)",
|
|
"command": "bash .agents/hooks/enforce-git-hygiene.sh"
|
|
}
|
|
],
|
|
"description": "Block git add . and dangerous patterns"
|
|
}
|
|
]
|
|
}
|
|
}
|