Skip to content

Commit

Permalink
fix empty ref for cron workflow runs (go-gitea#28640) (go-gitea#28647)
Browse files Browse the repository at this point in the history
Backport go-gitea#28640 by @denyskon

Fix go-gitea#27678 
Please see
go-gitea#27678 (comment)
for details.

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
  • Loading branch information
GiteaBot and denyskon authored Dec 29, 2023
1 parent ff565a7 commit 683b95f
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 @@ -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
}

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 683b95f

Please sign in to comment.