This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

core / appview / pages / templates / repo / pulls / fragments / triggerCi.html
2.2 kB 49 lines
1{{ define "repo/pulls/fragments/runCiButton" }} 2 <button 3 class="btn-flat p-2 flex items-center gap-2 flex-shrink-0 group" 4 hx-post="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/trigger-ci{{ if .Confirm }}?confirm=1{{ end }}" 5 hx-swap="none" 6 hx-disabled-elt="this" 7 {{ if .Confirm }}hx-confirm="{{ .Confirm }}"{{ end }} 8 > 9 {{ i "circle-play" "w-4 h-4 inline group-[.htmx-request]:hidden" }} 10 {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 11 Run CI 12 </button> 13{{ end }} 14 15{{ define "repo/pulls/fragments/triggerCi" }} 16{{ if .WorkflowsChanged }} 17<details class="group/ci"> 18 <summary class="flex items-center justify-between gap-2 cursor-pointer list-none"> 19 <div class="flex items-center gap-2 min-w-0 text-amber-600 dark:text-amber-500"> 20 {{ i "triangle-alert" "w-4 h-4 flex-shrink-0" }} 21 <span class="font-medium truncate">Workflow files changed in this round</span> 22 <div class="text-sm text-gray-500 dark:text-gray-400"> 23 <span class="group-open/ci:hidden inline">Expand</span> 24 <span class="hidden group-open/ci:inline">Collapse</span> 25 </div> 26 </div> 27 </summary> 28 <ul class="space-y-1 mt-2 overflow-x-auto"> 29 {{ range .ChangedWorkflowFiles }} 30 <li class="flex items-center whitespace-nowrap"> 31 {{ i "file-warning" "inline-flex w-4 h-4 mr-1.5 text-amber-600 dark:text-amber-500 flex-shrink-0" }} 32 <span class="font-mono">{{ . }}</span> 33 </li> 34 {{ end }} 35 </ul> 36 <div class="mt-2"> 37 {{ $confirm := printf "Workflow files changed in this round (%s). Review before running. Run anyway?" (join .ChangedWorkflowFiles ", ") }} 38 {{ template "repo/pulls/fragments/runCiButton" (dict "RepoInfo" .RepoInfo "Pull" .Pull "Confirm" $confirm) }} 39 </div> 40</details> 41{{ else }} 42<div class="flex items-center gap-2 text-gray-600 dark:text-gray-400"> 43 {{ i "circle-play" "w-4 h-4 flex-shrink-0" }} 44 <span class="font-medium">CI hasn't run on the latest commit</span> 45 {{ template "repo/pulls/fragments/runCiButton" (dict "RepoInfo" .RepoInfo "Pull" .Pull "Confirm" "") }} 46</div> 47{{ end }} 48<div id="pull-error" class="text-red-500 dark:text-red-400"></div> 49{{ end }}