Skip to content

Commit 470cc40

Browse files
denyskonsilverwind
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 74d5e33 commit 470cc40

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
@@ -195,7 +195,7 @@ func notify(ctx context.Context, input *notifyInput) error {
195195
}
196196
}
197197

198-
if err := handleSchedules(ctx, schedules, commit, input); err != nil {
198+
if err := handleSchedules(ctx, schedules, commit, input, ref); err != nil {
199199
return err
200200
}
201201

@@ -399,6 +399,7 @@ func handleSchedules(
399399
detectedWorkflows []*actions_module.DetectedWorkflow,
400400
commit *git.Commit,
401401
input *notifyInput,
402+
ref string,
402403
) error {
403404
branch, err := commit.GetBranchName()
404405
if err != nil {
@@ -448,7 +449,7 @@ func handleSchedules(
448449
OwnerID: input.Repo.OwnerID,
449450
WorkflowID: dwf.EntryName,
450451
TriggerUserID: input.Doer.ID,
451-
Ref: input.Ref,
452+
Ref: ref,
452453
CommitSHA: commit.ID.String(),
453454
Event: input.Event,
454455
EventPayload: string(p),

0 commit comments

Comments
 (0)