From b66d49e0f1cbdce31859083ed08474f2249d8b20 Mon Sep 17 00:00:00 2001 From: NorthRealm <155140859+NorthRealm@users.noreply.github.com> Date: Sun, 22 Jun 2025 18:19:30 +0800 Subject: [PATCH 1/2] add --- options/locale/locale_en-US.ini | 1 + routers/web/repo/actions/actions.go | 1 + templates/repo/actions/runs_list.tmpl | 5 +++++ templates/repo/actions/view_component.tmpl | 2 +- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 123c2da607ec5..c0614eecfcdaf 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -3817,6 +3817,7 @@ runs.no_runs = The workflow has no runs yet. runs.empty_commit_message = (empty commit message) runs.expire_log_message = Logs have been purged because they were too old. runs.delete = Delete workflow run +runs.cancel = Cancel workflow run runs.delete.description = Are you sure you want to permanently delete this workflow run? This action cannot be undone. runs.not_done = This workflow run is not done. runs.view_workflow_file = View workflow file diff --git a/routers/web/repo/actions/actions.go b/routers/web/repo/actions/actions.go index 7f219811bdc71..31e5ce2df69ce 100644 --- a/routers/web/repo/actions/actions.go +++ b/routers/web/repo/actions/actions.go @@ -319,6 +319,7 @@ func prepareWorkflowList(ctx *context.Context, workflows []Workflow) { ctx.Data["HasWorkflowsOrRuns"] = len(workflows) > 0 || len(runs) > 0 ctx.Data["AllowDeleteWorkflowRuns"] = ctx.Repo.CanWrite(unit.TypeActions) + ctx.Data["AllowCancelWorkflowRuns"] = ctx.Repo.CanWrite(unit.TypeActions) } // loadIsRefDeleted loads the IsRefDeleted field for each run in the list. diff --git a/templates/repo/actions/runs_list.tmpl b/templates/repo/actions/runs_list.tmpl index fdb631f0eea05..ddfe266531b5a 100644 --- a/templates/repo/actions/runs_list.tmpl +++ b/templates/repo/actions/runs_list.tmpl @@ -40,6 +40,11 @@ {{svg "octicon-kebab-horizontal"}}