Skip to content

Commit f258f59

Browse files
denyskonGiteaBot
authored andcommitted
fix empty ref for cron workflow runs (go-gitea#28640)
Fix go-gitea#27678 Please see go-gitea#27678 (comment) for details.
1 parent 373e788 commit f258f59

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)