diff --git a/modules/actions/github.go b/modules/actions/github.go index cc04ca5c5..278b7cb74 100644 --- a/modules/actions/github.go +++ b/modules/actions/github.go @@ -22,7 +22,6 @@ const ( GithubEventRelease = "release" GithubEventPullRequestComment = "pull_request_comment" GithubEventGollum = "gollum" - GithubEventSchedule = "schedule" ) // IsDefaultBranchWorkflow returns true if the event only triggers workflows on the default branch @@ -74,9 +73,6 @@ func canGithubEventMatch(eventName string, triggedEvent webhook_module.HookEvent case GithubEventGollum: return triggedEvent == webhook_module.HookEventWiki - case GithubEventSchedule: - return triggedEvent == webhook_module.HookEventSchedule - case GithubEventIssues: switch triggedEvent { case webhook_module.HookEventIssues, diff --git a/modules/actions/workflows.go b/modules/actions/workflows.go index 8317f16db..60dd05f0b 100644 --- a/modules/actions/workflows.go +++ b/modules/actions/workflows.go @@ -153,7 +153,6 @@ func detectMatched(gitRepo *git.Repository, commit *git.Commit, triggedEvent web switch triggedEvent { case // events with no activity types - webhook_module.HookEventSchedule, webhook_module.HookEventCreate, webhook_module.HookEventDelete, webhook_module.HookEventFork, diff --git a/modules/actions/workflows_test.go b/modules/actions/workflows_test.go index c8e1e553f..2d57f1948 100644 --- a/modules/actions/workflows_test.go +++ b/modules/actions/workflows_test.go @@ -118,13 +118,6 @@ func TestDetectMatched(t *testing.T) { yamlOn: "on: gollum", expected: true, }, - { - desc: "HookEventSchedue(schedule) matches GithubEventSchedule(schedule)", - triggedEvent: webhook_module.HookEventSchedule, - payload: nil, - yamlOn: "on: schedule", - expected: true, - }, } for _, tc := range testCases { diff --git a/modules/webhook/type.go b/modules/webhook/type.go index 0d2aef5e1..7f427f2ea 100644 --- a/modules/webhook/type.go +++ b/modules/webhook/type.go @@ -31,7 +31,6 @@ const ( HookEventRepository HookEventType = "repository" HookEventRelease HookEventType = "release" HookEventPackage HookEventType = "package" - HookEventSchedule HookEventType = "schedule" ) // Event returns the HookEventType as an event string diff --git a/services/actions/notifier_helper.go b/services/actions/notifier_helper.go index 99f2dd07d..58e67ffae 100644 --- a/services/actions/notifier_helper.go +++ b/services/actions/notifier_helper.go @@ -508,7 +508,7 @@ func handleSchedules( TriggerUserID: input.Doer.ID, Ref: input.Repo.DefaultBranch, CommitSHA: commit.ID.String(), - Event: webhook_module.HookEventType(api.HookScheduleCreated), + Event: input.Event, EventPayload: string(p), Specs: schedules, Content: dwf.Content, diff --git a/services/actions/schedule_tasks.go b/services/actions/schedule_tasks.go index dfde34d99..8eef2b67b 100644 --- a/services/actions/schedule_tasks.go +++ b/services/actions/schedule_tasks.go @@ -112,7 +112,6 @@ func CreateScheduleTask(ctx context.Context, cron *actions_model.ActionSchedule) Ref: cron.Ref, CommitSHA: cron.CommitSHA, Event: cron.Event, - TriggerEvent: string(webhook_module.HookEventSchedule), EventPayload: cron.EventPayload, ScheduleID: cron.ID, Status: actions_model.StatusWaiting,