require-valid-repository-hook-command-type
Require repository hook definitions to declare a supported type value such as command or prompt.
Rule catalog ID: R060
Targeted pattern scopeâ
.github/hooks/**/*.json
What this rule reportsâ
- hook objects with a missing
type - hook objects whose
typeis not a supported string
Why this rule existsâ
Each hook definition needs an explicit type so Copilot knows how to interpret it. Requiring a supported type catches incomplete hook entries and obvious schema mismatches.
â Incorrectâ
{
"version": 1,
"hooks": {
"sessionStart": [{ "bash": "echo ready" }]
}
}
â Correctâ
{
"version": 1,
"hooks": {
"sessionStart": [{ "type": "command", "bash": "echo ready" }]
}
}