| 1 | {{ define "page" -}} |
| 2 | <div class="shithub-settings-page"> |
| 3 | {{ template "repo-settings-nav" . }} |
| 4 | <div class="shithub-settings-content"> |
| 5 | <h1>Actions settings</h1> |
| 6 | {{ with .Notice }}<p class="shithub-flash shithub-flash-notice" role="status">{{ . }}</p>{{ end }} |
| 7 | {{ with .Error }}<p class="shithub-flash shithub-flash-error" role="alert">{{ . }}</p>{{ end }} |
| 8 | |
| 9 | <section class="shithub-settings-section"> |
| 10 | <h2>Actions policy</h2> |
| 11 | <form method="POST" action="/{{ .Owner }}/{{ .Repo.Name }}/settings/actions" novalidate> |
| 12 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 13 | <label> |
| 14 | <span>Actions</span> |
| 15 | <select name="actions_enabled"> |
| 16 | <option value="inherit"{{ if eq .Policy.ActionsEnabled "inherit" }} selected{{ end }}>Use inherited policy</option> |
| 17 | <option value="enabled"{{ if eq .Policy.ActionsEnabled "enabled" }} selected{{ end }}>Enabled</option> |
| 18 | <option value="disabled"{{ if eq .Policy.ActionsEnabled "disabled" }} selected{{ end }}>Disabled</option> |
| 19 | </select> |
| 20 | </label> |
| 21 | <label> |
| 22 | <span>Pull request approval</span> |
| 23 | <select name="require_pr_approval"> |
| 24 | <option value="inherit"{{ if eq .Policy.RequirePRApproval "inherit" }} selected{{ end }}>Use inherited policy</option> |
| 25 | <option value="true"{{ if eq .Policy.RequirePRApproval "true" }} selected{{ end }}>Require maintainer approval</option> |
| 26 | <option value="false"{{ if eq .Policy.RequirePRApproval "false" }} selected{{ end }}>Do not require approval</option> |
| 27 | </select> |
| 28 | </label> |
| 29 | <label> |
| 30 | <span>Queued runs per repository</span> |
| 31 | <input type="number" name="max_repo_queued_runs" min="0" step="1" value="{{ .Policy.MaxRepoQueuedRuns }}" placeholder="{{ .Policy.EffectiveMaxRepoQueuedRuns }}"> |
| 32 | </label> |
| 33 | <label> |
| 34 | <span>Concurrent jobs per repository</span> |
| 35 | <input type="number" name="max_repo_concurrent_jobs" min="0" step="1" value="{{ .Policy.MaxRepoConcurrentJobs }}" placeholder="{{ .Policy.EffectiveMaxRepoConcurrent }}"> |
| 36 | </label> |
| 37 | <label> |
| 38 | <span>Concurrent jobs per owner</span> |
| 39 | <input type="number" name="max_owner_concurrent_jobs" min="0" step="1" value="{{ .Policy.MaxOwnerConcurrentJobs }}" placeholder="{{ .Policy.EffectiveMaxOwnerConcurrent }}"> |
| 40 | </label> |
| 41 | <label> |
| 42 | <span>Triggers per actor per hour</span> |
| 43 | <input type="number" name="actor_trigger_limit_per_hour" min="0" step="1" value="{{ .Policy.ActorTriggerLimitPerHour }}" placeholder="{{ .Policy.EffectiveActorHourlyLimit }}"> |
| 44 | </label> |
| 45 | <button type="submit" class="shithub-button shithub-button-primary">Save policy</button> |
| 46 | </form> |
| 47 | </section> |
| 48 | |
| 49 | <section class="shithub-settings-section"> |
| 50 | <h2>Effective policy</h2> |
| 51 | <table class="shithub-branches-table"> |
| 52 | <tbody> |
| 53 | <tr><th>Actions</th><td>{{ if .Policy.EffectiveActionsEnabled }}enabled{{ else }}disabled{{ end }}</td></tr> |
| 54 | <tr><th>Pull request approval</th><td>{{ if .Policy.EffectiveRequirePRApproval }}required{{ else }}not required{{ end }}</td></tr> |
| 55 | <tr><th>Queued runs per repository</th><td>{{ .Policy.EffectiveMaxRepoQueuedRuns }}</td></tr> |
| 56 | <tr><th>Concurrent jobs per repository</th><td>{{ .Policy.EffectiveMaxRepoConcurrent }}</td></tr> |
| 57 | <tr><th>Concurrent jobs per owner</th><td>{{ .Policy.EffectiveMaxOwnerConcurrent }}</td></tr> |
| 58 | <tr><th>Triggers per actor per hour</th><td>{{ .Policy.EffectiveActorHourlyLimit }}</td></tr> |
| 59 | </tbody> |
| 60 | </table> |
| 61 | </section> |
| 62 | </div> |
| 63 | </div> |
| 64 | {{- end }} |