Rules are defined in configuration files for both SaaS and self-hosted deployments. Use the dashboard to view and test rule behavior. The same CLI reads rules from either endpoint.
Fields
- when: JSONPath boolean expression
- emit: Single topic name for workers (Cloud enforces exactly one)
- drivers: Driver IDs for delivery destinations (required in Cloud)
- enabled: Toggle to stop or resume evaluation
- transformJs: Optional JavaScript function that mutates the payload after a match and before publish
Example
when: action == "opened" && pull_request.draft == false
emit: pr.opened.ready
drivers: ["drv_123"]
transformJs: |
function transform(payload) {
payload.source = "dashboard";
return payload;
}
Use the Drivers page to copy driver IDs. In SaaS, rules must reference valid driver IDs and CLI calls require GITHOOK_API_KEY. In self-hosted deployments, rules use config and the CLI runs without auth by default (OAuth2 optional).