From 8d799c236c854c8bb132b38c97385beaf53d9327 Mon Sep 17 00:00:00 2001 From: badhezi Date: Tue, 15 Apr 2025 19:56:19 +0300 Subject: [PATCH 1/4] use the correct context data for PR link template in issue card --- templates/repo/issue/card.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/issue/card.tmpl b/templates/repo/issue/card.tmpl index c7bbe91885012..41fe6cea8fbae 100644 --- a/templates/repo/issue/card.tmpl +++ b/templates/repo/issue/card.tmpl @@ -45,7 +45,7 @@ {{if $.Page.LinkedPRs}} {{range index $.Page.LinkedPRs .ID}}
- + {{svg "octicon-git-merge" 16 "tw-mr-1 tw-align-middle"}} {{.Title}} #{{.Index}} From d0386a67ec605de8b0cd2f285b677d2acc79639b Mon Sep 17 00:00:00 2001 From: badhezi Date: Fri, 3 Oct 2025 16:25:42 +0300 Subject: [PATCH 2/4] update job.Status on re-run trigger to avoid duplicate email notifications --- routers/web/repo/actions/view.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/routers/web/repo/actions/view.go b/routers/web/repo/actions/view.go index 3422128026ffd..a84d554d4f069 100644 --- a/routers/web/repo/actions/view.go +++ b/routers/web/repo/actions/view.go @@ -420,11 +420,14 @@ func Rerun(ctx *context_module.Context) { return } - // reset run's start and stop time when it is done + // reset run's start and stop time when if is done if run.Status.IsDone() { run.PreviousDuration = run.Duration() run.Started = 0 run.Stopped = 0 + // Set run to waiting status so next job.Status evaluations reflect the status after the re-run trigger + // Avoid re-triggering email notification before the new job run ends + run.Status = 1 if err := actions_model.UpdateRun(ctx, run, "started", "stopped", "previous_duration"); err != nil { ctx.ServerError("UpdateRun", err) return From 540b8531df9a468d48e30e8e9da7b1db6577d1e1 Mon Sep 17 00:00:00 2001 From: badhezi Date: Fri, 3 Oct 2025 16:29:13 +0300 Subject: [PATCH 3/4] fix comment --- routers/web/repo/actions/view.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/web/repo/actions/view.go b/routers/web/repo/actions/view.go index a84d554d4f069..35d1a73d83dd1 100644 --- a/routers/web/repo/actions/view.go +++ b/routers/web/repo/actions/view.go @@ -420,7 +420,7 @@ func Rerun(ctx *context_module.Context) { return } - // reset run's start and stop time when if is done + // reset run's start stop time and status if it is done if run.Status.IsDone() { run.PreviousDuration = run.Duration() run.Started = 0 From 854cd391b77d73a6105247b86197893b59153f59 Mon Sep 17 00:00:00 2001 From: badhezi Date: Fri, 3 Oct 2025 20:39:50 +0300 Subject: [PATCH 4/4] skip redundant workflow run status update --- routers/web/repo/actions/view.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/routers/web/repo/actions/view.go b/routers/web/repo/actions/view.go index 35d1a73d83dd1..8f567e2b9b9d4 100644 --- a/routers/web/repo/actions/view.go +++ b/routers/web/repo/actions/view.go @@ -420,14 +420,11 @@ func Rerun(ctx *context_module.Context) { return } - // reset run's start stop time and status if it is done + // reset run's start and stop time when it is done if run.Status.IsDone() { run.PreviousDuration = run.Duration() run.Started = 0 run.Stopped = 0 - // Set run to waiting status so next job.Status evaluations reflect the status after the re-run trigger - // Avoid re-triggering email notification before the new job run ends - run.Status = 1 if err := actions_model.UpdateRun(ctx, run, "started", "stopped", "previous_duration"); err != nil { ctx.ServerError("UpdateRun", err) return @@ -437,7 +434,6 @@ func Rerun(ctx *context_module.Context) { ctx.ServerError("run.LoadAttributes", err) return } - notify_service.WorkflowRunStatusUpdate(ctx, run.Repo, run.TriggerUser, run) } job, jobs := getRunJobs(ctx, runIndex, jobIndex)