Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidAction = errors.New("invalid action") ErrInvalidEventType = errors.New("invalid event type") )
View Source
var ( ErrWebhookRequestFailed = errors.New("webhook request failed") ErrWebhookMissingURL = errors.New("webhook missing url") )
View Source
var ErrUnknownHookType = errors.New("unknown hook type")
Functions ¶
Types ¶
type Action ¶
type Action struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
On OnEvents `yaml:"on"`
Hooks []ActionHook `yaml:"hooks"`
}
func LoadActions ¶
func ParseAction ¶
ParseAction helper function to read, parse and validate Action from a reader
type ActionHook ¶
type Hook ¶
type Hook interface {
Run(ctx context.Context, runID string, event Event, writer OutputWriter) error
}
func NewWebhook ¶
func NewWebhook(action *Action, h ActionHook) (Hook, error)
type NewHookFunc ¶
type NewHookFunc func(*Action, ActionHook) (Hook, error)
type OutputWriter ¶
type WebhookEventInfo ¶
type WebhookEventInfo struct {
RunID string `json:"run_id"`
EventType string `json:"event_type"`
EventTime string `json:"event_time"`
ActionName string `json:"action_name"`
HookID string `json:"hook_id"`
RepositoryID string `json:"repository_id"`
BranchID string `json:"branch_id"`
SourceRef string `json:"source_ref"`
CommitMessage string `json:"commit_message"`
Committer string `json:"committer"`
Metadata map[string]string `json:"metadata"`
}
Click to show internal directories.
Click to hide internal directories.