mirror of https://github.com/go-gitea/gitea.git
Backport #32246 Fix #32219 Co-authored-by: delvh <dev.lh@web.de>
This commit is contained in:
parent
24b65f122a
commit
55562f9c79
|
@ -115,11 +115,20 @@ func (input *notifyInput) Notify(ctx context.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func notify(ctx context.Context, input *notifyInput) error {
|
func notify(ctx context.Context, input *notifyInput) error {
|
||||||
|
shouldDetectSchedules := input.Event == webhook_module.HookEventPush && input.Ref.BranchName() == input.Repo.DefaultBranch
|
||||||
if input.Doer.IsActions() {
|
if input.Doer.IsActions() {
|
||||||
// avoiding triggering cyclically, for example:
|
// avoiding triggering cyclically, for example:
|
||||||
// a comment of an issue will trigger the runner to add a new comment as reply,
|
// a comment of an issue will trigger the runner to add a new comment as reply,
|
||||||
// and the new comment will trigger the runner again.
|
// and the new comment will trigger the runner again.
|
||||||
log.Debug("ignore executing %v for event %v whose doer is %v", getMethod(ctx), input.Event, input.Doer.Name)
|
log.Debug("ignore executing %v for event %v whose doer is %v", getMethod(ctx), input.Event, input.Doer.Name)
|
||||||
|
|
||||||
|
// we should update schedule tasks in this case, because
|
||||||
|
// 1. schedule tasks cannot be triggered by other events, so cyclic triggering will not occur
|
||||||
|
// 2. some schedule tasks may update the repo periodically, so the refs of schedule tasks need to be updated
|
||||||
|
if shouldDetectSchedules {
|
||||||
|
return DetectAndHandleSchedules(ctx, input.Repo)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if input.Repo.IsEmpty || input.Repo.IsArchived {
|
if input.Repo.IsEmpty || input.Repo.IsArchived {
|
||||||
|
@ -173,7 +182,6 @@ func notify(ctx context.Context, input *notifyInput) error {
|
||||||
|
|
||||||
var detectedWorkflows []*actions_module.DetectedWorkflow
|
var detectedWorkflows []*actions_module.DetectedWorkflow
|
||||||
actionsConfig := input.Repo.MustGetUnit(ctx, unit_model.TypeActions).ActionsConfig()
|
actionsConfig := input.Repo.MustGetUnit(ctx, unit_model.TypeActions).ActionsConfig()
|
||||||
shouldDetectSchedules := input.Event == webhook_module.HookEventPush && input.Ref.BranchName() == input.Repo.DefaultBranch
|
|
||||||
workflows, schedules, err := actions_module.DetectWorkflows(gitRepo, commit,
|
workflows, schedules, err := actions_module.DetectWorkflows(gitRepo, commit,
|
||||||
input.Event,
|
input.Event,
|
||||||
input.Payload,
|
input.Payload,
|
||||||
|
|
Loading…
Reference in New Issue