Skip to content

Commit 683b95f

Browse files
GiteaBotdenyskon
andauthored
fix empty ref for cron workflow runs (#28640) (#28647)
Backport #28640 by @denyskon Fix #27678 Please see #27678 (comment) for details. Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
1 parent ff565a7 commit 683b95f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

services/actions/notifier_helper.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func notify(ctx context.Context, input *notifyInput) error {
188188
}
189189
}
190190

191-
if err := handleSchedules(ctx, schedules, commit, input); err != nil {
191+
if err := handleSchedules(ctx, schedules, commit, input, ref); err != nil {
192192
return err
193193
}
194194

@@ -373,6 +373,7 @@ func handleSchedules(
373373
detectedWorkflows []*actions_module.DetectedWorkflow,
374374
commit *git.Commit,
375375
input *notifyInput,
376+
ref string,
376377
) error {
377378
branch, err := commit.GetBranchName()
378379
if err != nil {
@@ -422,7 +423,7 @@ func handleSchedules(
422423
OwnerID: input.Repo.OwnerID,
423424
WorkflowID: dwf.EntryName,
424425
TriggerUserID: input.Doer.ID,
425-
Ref: input.Ref,
426+
Ref: ref,
426427
CommitSHA: commit.ID.String(),
427428
Event: input.Event,
428429
EventPayload: string(p),

0 commit comments

Comments
 (0)