]> source.dussan.org Git - gitea.git/commitdiff
Add empty repo check in DetectAndHandleSchedules (#29606) (#29659)
authoryp05327 <576951401@qq.com>
Fri, 8 Mar 2024 09:50:04 +0000 (18:50 +0900)
committerGitHub <noreply@github.com>
Fri, 8 Mar 2024 09:50:04 +0000 (09:50 +0000)
Backport #29606

services/actions/notifier_helper.go

index fe618d5d08e63892fdad62ea990ca4a343702cc7..807494fb04a01fbca499be7c6f8d60367689e6cd 100644 (file)
@@ -459,6 +459,10 @@ func handleSchedules(
 
 // DetectAndHandleSchedules detects the schedule workflows on the default branch and create schedule tasks
 func DetectAndHandleSchedules(ctx context.Context, repo *repo_model.Repository) error {
+       if repo.IsEmpty {
+               return nil
+       }
+
        gitRepo, err := git.OpenRepository(context.Background(), repo.RepoPath())
        if err != nil {
                return fmt.Errorf("git.OpenRepository: %w", err)