Skip to content

Commit

Permalink
fix empty ref for cron workflow runs (#28640)
Browse files Browse the repository at this point in the history
Fix #27678 
Please see
#27678 (comment)
for details.
  • Loading branch information
denyskon authored Dec 29, 2023
1 parent 19c45dd commit f10d716
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions services/actions/notifier_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,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
}

Expand Down Expand Up @@ -399,6 +399,7 @@ func handleSchedules(
detectedWorkflows []*actions_module.DetectedWorkflow,
commit *git.Commit,
input *notifyInput,
ref string,
) error {
branch, err := commit.GetBranchName()
if err != nil {
Expand Down Expand Up @@ -448,7 +449,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),
Expand Down

0 comments on commit f10d716

Please sign in to comment.