hard code event workflow_dispatch for now

This commit is contained in:
pangliang 2023-12-07 14:52:13 +08:00
parent a7c0016f83
commit 36c47f135a
1 changed files with 4 additions and 5 deletions

View File

@ -29,7 +29,6 @@ import (
"code.gitea.io/gitea/modules/timeutil"
"code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/modules/web"
webhook_module "code.gitea.io/gitea/modules/webhook"
actions_service "code.gitea.io/gitea/services/actions"
context_module "code.gitea.io/gitea/services/context"
@ -692,7 +691,7 @@ func Run(ctx *context_module.Context) {
ref := ctx.FormString("ref")
if len(ref) == 0 {
ctx.ServerError("workflow", nil)
ctx.ServerError("ref", nil)
return
}
@ -746,7 +745,7 @@ func Run(ctx *context_module.Context) {
}
dwf = &actions.DetectedWorkflow{
EntryName: entry.Name(),
TriggerEvent: webhook_module.HookEventWorkflowDispatch.Event(),
TriggerEvent: "workflow_dispatch",
Content: content,
}
break
@ -768,8 +767,8 @@ func Run(ctx *context_module.Context) {
Ref: ref,
CommitSHA: runTargetCommit.ID.String(),
IsForkPullRequest: false,
Event: webhook_module.HookEventWorkflowDispatch,
TriggerEvent: webhook_module.HookEventWorkflowDispatch.Event(),
Event: "workflow_dispatch",
TriggerEvent: "workflow_dispatch",
Status: actions_model.StatusWaiting,
}