summaryrefslogtreecommitdiffstats
path: root/models/actions/run_list.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/actions/run_list.go')
-rw-r--r--models/actions/run_list.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/models/actions/run_list.go b/models/actions/run_list.go
index 375c46221b..388bfc4f86 100644
--- a/models/actions/run_list.go
+++ b/models/actions/run_list.go
@@ -10,6 +10,7 @@ import (
repo_model "code.gitea.io/gitea/models/repo"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/container"
+ webhook_module "code.gitea.io/gitea/modules/webhook"
"xorm.io/builder"
)
@@ -71,6 +72,7 @@ type FindRunOptions struct {
WorkflowID string
Ref string // the commit/tag/… that caused this workflow
TriggerUserID int64
+ TriggerEvent webhook_module.HookEventType
Approved bool // not util.OptionalBool, it works only when it's true
Status []Status
}
@@ -98,6 +100,9 @@ func (opts FindRunOptions) ToConds() builder.Cond {
if opts.Ref != "" {
cond = cond.And(builder.Eq{"ref": opts.Ref})
}
+ if opts.TriggerEvent != "" {
+ cond = cond.And(builder.Eq{"trigger_event": opts.TriggerEvent})
+ }
return cond
}