Skip to content

Commit bd7de0c

Browse files
authored
Add empty repo check in DetectAndHandleSchedules (#29606) (#29659)
Backport #29606
1 parent 6651d2d commit bd7de0c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

services/actions/notifier_helper.go

+4
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,10 @@ func handleSchedules(
459459

460460
// DetectAndHandleSchedules detects the schedule workflows on the default branch and create schedule tasks
461461
func DetectAndHandleSchedules(ctx context.Context, repo *repo_model.Repository) error {
462+
if repo.IsEmpty {
463+
return nil
464+
}
465+
462466
gitRepo, err := git.OpenRepository(context.Background(), repo.RepoPath())
463467
if err != nil {
464468
return fmt.Errorf("git.OpenRepository: %w", err)

0 commit comments

Comments
 (0)