require-string-repository-hook-env-values
Require repository hook env objects to use string values.
Rule catalog ID: R066
Targeted pattern scopeâ
.github/hooks/**/*.json
What this rule reportsâ
envobjects that contain non-string values such as numbers, arrays, or nested objects
Why this rule existsâ
Environment variables are string-based in practice. Requiring string values avoids surprising serialization behavior and keeps hook environment configuration aligned with how shells consume variables.
â Incorrectâ
{
"version": 1,
"hooks": {
"sessionStart": [{ "type": "command", "bash": "echo ready", "env": { "RETRIES": 3 } }]
}
}
â Correctâ
{
"version": 1,
"hooks": {
"sessionStart": [{ "type": "command", "bash": "echo ready", "env": { "RETRIES": "3" } }]
}
}