require-repository-hook-command-shell
Require repository command hook definitions to declare at least one shell command under bash or powershell.
Rule catalog ID: R061
Targeted pattern scopeâ
.github/hooks/**/*.json
What this rule reportsâ
type: "command"hook objects that omit bothbashandpowershellcommandhook objects whose shell command fields are blank
Why this rule existsâ
A command hook without an executable shell command cannot do anything useful. Requiring at least one non-empty shell command catches incomplete hook definitions before they reach runtime.
â Incorrectâ
{
"version": 1,
"hooks": {
"sessionStart": [{ "type": "command" }]
}
}
â Correctâ
{
"version": 1,
"hooks": {
"sessionStart": [{ "type": "command", "bash": "echo ready" }]
}
}