From a7fed66abdf7cf08a98b5ee2c8dcc9dbd07b2c4d Mon Sep 17 00:00:00 2001 From: NorthRealm <155140859+NorthRealm@users.noreply.github.com> Date: Mon, 23 Jun 2025 00:00:38 +0800 Subject: [PATCH 1/3] update --- routers/web/repo/actions/view.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/routers/web/repo/actions/view.go b/routers/web/repo/actions/view.go index 7e1b923fa4b05..52b2e9995e3ba 100644 --- a/routers/web/repo/actions/view.go +++ b/routers/web/repo/actions/view.go @@ -249,7 +249,7 @@ func ViewPost(ctx *context_module.Context) { ID: v.ID, Name: v.Name, Status: v.Status.String(), - CanRerun: v.Status.IsDone() && ctx.Repo.CanWrite(unit.TypeActions), + CanRerun: resp.State.Run.CanRerun, Duration: v.Duration().String(), }) } @@ -445,7 +445,7 @@ func Rerun(ctx *context_module.Context) { return } } - ctx.JSON(http.StatusOK, struct{}{}) + ctx.JSONOK() return } @@ -460,12 +460,12 @@ func Rerun(ctx *context_module.Context) { } } - ctx.JSON(http.StatusOK, struct{}{}) + ctx.JSONOK() } func rerunJob(ctx *context_module.Context, job *actions_model.ActionRunJob, shouldBlock bool) error { status := job.Status - if !status.IsDone() { + if !status.IsDone() || !job.Run.Status.IsDone() { return nil } From 1b34325e159692ec320f9e8e7707cea53b86cb50 Mon Sep 17 00:00:00 2001 From: NorthRealm <155140859+NorthRealm@users.noreply.github.com> Date: Tue, 24 Jun 2025 16:39:42 +0800 Subject: [PATCH 2/3] update --- 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 52b2e9995e3ba..741f0cfe8bae3 100644 --- a/routers/web/repo/actions/view.go +++ b/routers/web/repo/actions/view.go @@ -249,7 +249,7 @@ func ViewPost(ctx *context_module.Context) { ID: v.ID, Name: v.Name, Status: v.Status.String(), - CanRerun: resp.State.Run.CanRerun, + CanRerun: resp.State.Run.CanRerun && !v.Status.IsSkipped(), Duration: v.Duration().String(), }) } From 0236230a101ea26de19370736d600ffb33312c69 Mon Sep 17 00:00:00 2001 From: NorthRealm <155140859+NorthRealm@users.noreply.github.com> Date: Sun, 6 Jul 2025 16:58:08 +0800 Subject: [PATCH 3/3] update --- 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 741f0cfe8bae3..52b2e9995e3ba 100644 --- a/routers/web/repo/actions/view.go +++ b/routers/web/repo/actions/view.go @@ -249,7 +249,7 @@ func ViewPost(ctx *context_module.Context) { ID: v.ID, Name: v.Name, Status: v.Status.String(), - CanRerun: resp.State.Run.CanRerun && !v.Status.IsSkipped(), + CanRerun: resp.State.Run.CanRerun, Duration: v.Duration().String(), }) }