From ab5fd3387b5e341480b1dbe3c274f4f1b6c4752b Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 14 Apr 2026 20:41:19 +0200 Subject: [PATCH] fixes --- routers/api/v1/repo/action.go | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/routers/api/v1/repo/action.go b/routers/api/v1/repo/action.go index cd24d1bb2d..5be2ae9c50 100644 --- a/routers/api/v1/repo/action.go +++ b/routers/api/v1/repo/action.go @@ -1028,14 +1028,23 @@ func ActionsListWorkflowRuns(ctx *context.APIContext) { // "$ref": "#/responses/notFound" workflowID := ctx.PathParam("workflow_id") - if _, err := convert.GetActionWorkflow(ctx, ctx.Repo.GitRepo, ctx.Repo.Repository, workflowID); err != nil { - if errors.Is(err, util.ErrNotExist) { - ctx.APIError(http.StatusNotFound, err) - } else { - ctx.APIErrorInternal(err) - } + runExists, err := db.GetEngine(ctx). + Where("repo_id = ? AND workflow_id = ?", ctx.Repo.Repository.ID, workflowID). + Exist(&actions_model.ActionRun{}) + if err != nil { + ctx.APIErrorInternal(err) return } + if !runExists { + if _, err := convert.GetActionWorkflow(ctx, ctx.Repo.GitRepo, ctx.Repo.Repository, workflowID); err != nil { + if errors.Is(err, util.ErrNotExist) { + ctx.APIError(http.StatusNotFound, err) + } else { + ctx.APIErrorInternal(err) + } + return + } + } repoID := ctx.Repo.Repository.ID