Skip to content

Commit 3c79139

Browse files
committed
update
1 parent 91a2a71 commit 3c79139

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

routers/web/repo/actions/actions.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,7 @@ func prepareWorkflowList(ctx *context.Context, workflows []Workflow) {
318318
ctx.Data["Page"] = pager
319319
ctx.Data["HasWorkflowsOrRuns"] = len(workflows) > 0 || len(runs) > 0
320320

321-
ctx.Data["AllowDeleteWorkflowRuns"] = ctx.Repo.CanWrite(unit.TypeActions)
322-
ctx.Data["AllowCancelWorkflowRuns"] = ctx.Repo.CanWrite(unit.TypeActions)
321+
ctx.Data["CanWriteRepoUnitActions"] = ctx.Repo.CanWrite(unit.TypeActions)
323322
}
324323

325324
// loadIsRefDeleted loads the IsRefDeleted field for each run in the list.

templates/repo/actions/runs_list.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@
4040
{{svg "octicon-kebab-horizontal"}}
4141
<div class="menu flex-items-menu">
4242
<a class="item" href="{{$run.Link}}/workflow">{{svg "octicon-play"}}{{ctx.Locale.Tr "actions.runs.view_workflow_file"}}</a>
43-
{{if and $.AllowCancelWorkflowRuns (not $run.Status.IsDone)}}
43+
{{if and $.CanWriteRepoUnitActions (not $run.Status.IsDone)}}
4444
<a class="item link-action" data-url="{{$run.Link}}/cancel">
4545
{{svg "octicon-x"}}{{ctx.Locale.Tr "actions.runs.cancel"}}
4646
</a>
4747
{{end}}
48-
{{if and $.AllowDeleteWorkflowRuns $run.Status.IsDone}}
48+
{{if and $.CanWriteRepoUnitActions $run.Status.IsDone}}
4949
<a class="item link-action"
5050
data-url="{{$run.Link}}/delete"
5151
data-modal-confirm="{{ctx.Locale.Tr "actions.runs.delete.description"}}"

0 commit comments

Comments
 (0)