feat(web): add automatic actions for open pull requests

A new pr_open alert carries the head commit SHA of each open, non-draft, same-repository pull request. An action with auto enabled sends its webhook once for each pull request and head commit. An authors list limits which pull requests trigger it. The alert never changes repository health.
This commit is contained in:
2026-10-05 00:41:08 +01:00
parent 23bbbedf59
commit c79ecb728f
15 changed files with 473 additions and 27 deletions
+5 -1
View File
@@ -81,7 +81,11 @@ func run(ctx context.Context, cfgPath string, log *slog.Logger) error {
srv := web.New(coll, promhttp.HandlerFor(reg, promhttp.HandlerOpts{}), ui, *cfg.ManualRefresh, log)
if len(cfg.Actions) > 0 {
srv.WithActions(web.NewActions(cfg.Actions, log, reg))
actions := web.NewActions(cfg.Actions, log, reg)
srv.WithActions(actions)
if auto := web.NewAutoRunner(actions); auto != nil {
coll.OnRefresh(auto.Run)
}
}
go coll.Run(ctx)