@@ -478,35 +478,3 @@ func handleSchedules(
478478
479479 return actions_model .CreateScheduleTask (ctx , crons )
480480}
481-
482- // DetectAndHandleSchedules detects the schedule workflows on the default branch and create schedule tasks
483- func DetectAndHandleSchedules (ctx context.Context , repo * repo_model.Repository ) error {
484- gitRepo , err := gitrepo .OpenRepository (context .Background (), repo )
485- if err != nil {
486- return fmt .Errorf ("git.OpenRepository: %w" , err )
487- }
488- defer gitRepo .Close ()
489-
490- // Only detect schedule workflows on the default branch
491- commit , err := gitRepo .GetCommit (repo .DefaultBranch )
492- if err != nil {
493- return fmt .Errorf ("gitRepo.GetCommit: %w" , err )
494- }
495- scheduleWorkflows , err := actions_module .DetectScheduledWorkflows (gitRepo , commit )
496- if err != nil {
497- return fmt .Errorf ("detect schedule workflows: %w" , err )
498- }
499- if len (scheduleWorkflows ) == 0 {
500- return nil
501- }
502-
503- // We need a notifyInput to call handleSchedules
504- // Here we use the commit author as the Doer of the notifyInput
505- commitUser , err := user_model .GetUserByEmail (ctx , commit .Author .Email )
506- if err != nil {
507- return fmt .Errorf ("get user by email: %w" , err )
508- }
509- notifyInput := newNotifyInput (repo , commitUser , webhook_module .HookEventSchedule )
510-
511- return handleSchedules (ctx , scheduleWorkflows , commit , notifyInput , repo .DefaultBranch )
512- }
0 commit comments