hook

package
v0.5.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package hook calls the user's own script when a ticket moves or is claimed.

It is the delivery escape hatch. Fetching refs tells a clone what changed the next time it looks, which is enough for a board but not for "tell me now" — and the ways people want to be told (a Slack webhook, ntfy.sh, Telegram, a terminal bell) are neither few nor stable. So jaira calls a script and brings no dependency of its own: the integration is the user's, the invocation is ours.

The contract is environment variables rather than arguments, so a script can read only what it cares about and adding a field later breaks nothing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExampleScript added in v0.2.0

func ExampleScript() string

ExampleScript returns a working hook script for someone who has just found the empty "hook" field in their settings and has no idea what belongs in it.

It is an example and not an installation: nothing here writes it anywhere or turns it on. The script is the user's once it lands on their disk, which is the same division Run already makes — jaira calls, the integration is theirs.

func Run

func Run(script string, ev Event) bool

Run calls the script, waiting no longer than the timeout.

Everything about a failure is silent: a hook is optional, its exit code is its own business, and a board that reported a broken script on every move would push the user to remove the feature rather than fix the script. The return value says whether it ran cleanly, for a caller that wants to say so on request.

Types

type Event

type Event struct {
	// Name is "move" or "claim".
	Name string
	// ID is the ticket's full id.
	ID string
	// Title, Status and Assignee describe the ticket after the change.
	Title    string
	Status   string
	Assignee string
	// Actor is who did it.
	Actor string
	// Root is the board's directory, so a script can work out which project
	// this is without being told separately.
	Root string
}

Event is what happened, and to which ticket.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL