⌨️Hook JSON Output
Also known as hookSpecificOutput, decision block, continue false
A JSON reply from a hook. It can say more than an exit code.
Think of it like
It is like you fill in a form. You do not just say yes or no.
Example
Jack's hook printed a JSON answer, but nothing happened. His shell profile echoed a line first. He silences it, and the JSON works.
Why it matters
Exit codes can only block or pass. JSON can allow, ask, add context or change input.
Definition
Example code
json
{
"continue": false,
"stopReason": "Build failed. Fix the errors before you go on."
}Common mistake
Key takeaways
- 1Exit 0 and print. One object.
- 2Shared and event fields. continue, decision.
- 3Nothing else on stdout. Or it is text.