Add empty repo check in `DetectAndHandleSchedules` (#29606)

![image](https://github.com/go-gitea/gitea/assets/18380374/e6081301-bd3e-4cf6-ba4e-e574348dffb4)
pull/29611/head^2
yp05327 8 months ago committed by GitHub
parent f147795924
commit 3f3335ae51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      services/actions/notifier_helper.go

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

Loading…
Cancel
Save