aboutsummaryrefslogtreecommitdiffstats
path: root/services/actions
diff options
context:
space:
mode:
authoryp05327 <576951401@qq.com>2024-03-05 23:47:07 +0900
committerGitHub <noreply@github.com>2024-03-05 14:47:07 +0000
commit3f3335ae51d89520acce6573e870590423248c5c (patch)
tree143a71fafe06d3a941cba75ef855bd83e754c0fd /services/actions
parentf14779592494d41b3ab04caaab53487f2f4ede5a (diff)
downloadgitea-3f3335ae51d89520acce6573e870590423248c5c.tar.gz
gitea-3f3335ae51d89520acce6573e870590423248c5c.zip
Add empty repo check in `DetectAndHandleSchedules` (#29606)
![image](https://github.com/go-gitea/gitea/assets/18380374/e6081301-bd3e-4cf6-ba4e-e574348dffb4)
Diffstat (limited to 'services/actions')
-rw-r--r--services/actions/notifier_helper.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/services/actions/notifier_helper.go b/services/actions/notifier_helper.go
index b248af1d01..b0d848b5ad 100644
--- a/services/actions/notifier_helper.go
+++ b/services/actions/notifier_helper.go
@@ -486,6 +486,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 := gitrepo.OpenRepository(context.Background(), repo)
if err != nil {
return fmt.Errorf("git.OpenRepository: %w", err)