mirror of
https://github.com/lukaszraczylo/ghtracker.git
synced 2026-10-12 00:45:38 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user