Skip to content

Commit a38a4ec

Browse files
committed
Fix
1 parent b78b1ba commit a38a4ec

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

routers/web/repo/actions/actions.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,8 @@ func prepareWorkflowList(ctx *context.Context, workflows []Workflow) {
317317
pager.AddParamFromRequest(ctx.Req)
318318
ctx.Data["Page"] = pager
319319
ctx.Data["HasWorkflowsOrRuns"] = len(workflows) > 0 || len(runs) > 0
320+
321+
ctx.Data["AllowDeleteWorkflowRuns"] = ctx.Repo.CanWrite(unit.TypeActions)
320322
}
321323

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

templates/repo/actions/runs_list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<div class="run-list-meta">{{svg "octicon-calendar" 16}}{{DateUtils.TimeSince .Updated}}</div>
3737
<div class="run-list-meta">{{svg "octicon-stopwatch" 16}}{{.Duration}}</div>
3838
</div>
39-
{{if and (.Link) (or (eq .Status.String "success") (eq .Status.String "skipped") (eq .Status.String "cancelled"))}}
39+
{{if and ($.AllowDeleteWorkflowRuns) (.Link) (or (eq .Status.String "success") (eq .Status.String "skipped") (eq .Status.String "cancelled"))}}
4040
<button class="ui btn interact-bg link-action tw-p-2"
4141
data-url="{{.Link}}/delete"
4242
data-modal-confirm="{{ctx.Locale.Tr "actions.runs.delete.description"}}"

0 commit comments

Comments
 (0)