mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-25 22:43:32 +00:00
fix empty ref for cron workflow runs (#28640)
Fix #27678 Please see https://github.com/go-gitea/gitea/issues/27678#issuecomment-1871445853 for details.
This commit is contained in:
parent
19c45dd479
commit
f10d716ff4
|
@ -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
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -399,6 +399,7 @@ func handleSchedules(
|
||||||
detectedWorkflows []*actions_module.DetectedWorkflow,
|
detectedWorkflows []*actions_module.DetectedWorkflow,
|
||||||
commit *git.Commit,
|
commit *git.Commit,
|
||||||
input *notifyInput,
|
input *notifyInput,
|
||||||
|
ref string,
|
||||||
) error {
|
) error {
|
||||||
branch, err := commit.GetBranchName()
|
branch, err := commit.GetBranchName()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -448,7 +449,7 @@ func handleSchedules(
|
||||||
OwnerID: input.Repo.OwnerID,
|
OwnerID: input.Repo.OwnerID,
|
||||||
WorkflowID: dwf.EntryName,
|
WorkflowID: dwf.EntryName,
|
||||||
TriggerUserID: input.Doer.ID,
|
TriggerUserID: input.Doer.ID,
|
||||||
Ref: input.Ref,
|
Ref: ref,
|
||||||
CommitSHA: commit.ID.String(),
|
CommitSHA: commit.ID.String(),
|
||||||
Event: input.Event,
|
Event: input.Event,
|
||||||
EventPayload: string(p),
|
EventPayload: string(p),
|
||||||
|
|
Loading…
Reference in a new issue