Skip to content

Commit 049eb90

Browse files
committed
fix
1 parent bd90b60 commit 049eb90

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

routers/web/repo/actions/view.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,10 @@ func Delete(ctx *context_module.Context) {
587587

588588
run, err := actions_model.GetRunByIndex(ctx, repoID, runIndex)
589589
if err != nil {
590+
if errors.Is(err, util.ErrNotExist) {
591+
ctx.HTTPError(http.StatusNotFound, err.Error())
592+
return
593+
}
590594
ctx.HTTPError(http.StatusInternalServerError, err.Error())
591595
return
592596
}

tests/integration/actions_delete_run_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ jobs:
160160
req = NewRequestWithValues(t, "POST", fmt.Sprintf("/%s/%s/actions/runs/%s/delete", user2.Name, apiRepo.Name, runIndex), map[string]string{
161161
"_csrf": GetUserCSRFToken(t, session),
162162
})
163-
session.MakeRequest(t, req, http.StatusInternalServerError)
163+
session.MakeRequest(t, req, http.StatusNotFound)
164164

165165
req = NewRequestWithValues(t, "GET", fmt.Sprintf("/%s/%s/actions/runs/%s", user2.Name, apiRepo.Name, runIndex), map[string]string{
166166
"_csrf": GetUserCSRFToken(t, session),

0 commit comments

Comments
 (0)