From f258f59fde34b298e129053ddd352c4ebe612a9f Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Fri, 29 Dec 2023 07:18:57 +0100 Subject: [PATCH] fix empty ref for cron workflow runs (#28640) Fix #27678 Please see https://github.com/go-gitea/gitea/issues/27678#issuecomment-1871445853 for details. --- services/actions/notifier_helper.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/actions/notifier_helper.go b/services/actions/notifier_helper.go index 7d5f6c6c0a3ce..714887f4ee343 100644 --- a/services/actions/notifier_helper.go +++ b/services/actions/notifier_helper.go @@ -188,7 +188,7 @@ func notify(ctx context.Context, input *notifyInput) error { } } - if err := handleSchedules(ctx, schedules, commit, input); err != nil { + if err := handleSchedules(ctx, schedules, commit, input, ref); err != nil { return err } @@ -373,6 +373,7 @@ func handleSchedules( detectedWorkflows []*actions_module.DetectedWorkflow, commit *git.Commit, input *notifyInput, + ref string, ) error { branch, err := commit.GetBranchName() if err != nil { @@ -422,7 +423,7 @@ func handleSchedules( OwnerID: input.Repo.OwnerID, WorkflowID: dwf.EntryName, TriggerUserID: input.Doer.ID, - Ref: input.Ref, + Ref: ref, CommitSHA: commit.ID.String(), Event: input.Event, EventPayload: string(p),