Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/git/vole.git

Write over SSH with a registered key:

git clone ssh://git@0.0.0.0:2222/vole.git

A free and open-source forge that lives in your Git repo.

Add event, schedule and manual workflow triggers

eb07ff5696e0d83201215966e3ea1e6a24467581 · Keenan Nemetz · 8d ago · parent 1cde8b9e

Add event, schedule and manual workflow triggers

Workflows can now react to change requests, issues, comments, cron
schedules and manual runs, and a push trigger can filter by the paths it
changed. Branch and tag patterns gain ! exclusion.

Event runs are pinned with a JSON payload and the runner exposes it as
VOLE_EVENT, VOLE_EVENT_ACTION and VOLE_EVENT_PATH. Change-request runs
check out the base tip and carry the head and changed files, so an event
never executes an unapproved contributor commit.

Workflow dispatch resolves typed inputs and is available from the
workflows page and `vole workflow dispatch`. Deduplication now includes
an occurrence so the same commit can run for a later event or schedule
slot while a push remains idempotent.

Part of: #138

server/web/templates/workflow_dispatch.html +55

@@ -0,0 +1,55 @@
1 {{define "workflow_dispatch"}}
2 {{template "header" .}}
3 {{template "repohead" (nav .Page "runs")}}
4
5 <div class="page-head">
6 <div class="page-head-main">
7 <h1>Run workflow</h1>
8 <p class="page-sub">{{if .Workflow}}{{.Workflow.Path}}{{else}}Choose a workflow{{end}} · a manual run of a workflow that declares <code>workflow-dispatch</code>.</p>
9 </div>
10 </div>
11
12 {{if .Error}}<div class="flash bad">{{.Error}}</div>{{end}}
13
14 {{if .Workflow}}
15 <form method="post" action="/r/{{.Name}}/workflows/dispatch" class="form-block">
16 <input type="hidden" name="csrf" value="{{.CSRF}}">
17 <input type="hidden" name="workflow" value="{{.Workflow.Path}}">
18 <div class="card form-card">
19 <label>Branch
20 <select name="ref">
21 {{range .Branches}}<option value="{{.}}"{{if eq . $.Ref}} selected{{end}}>{{.}}</option>{{end}}
22 </select>
23 </label>
24 <p class="muted">The workflow is read from this branch, and the job checks out its tip.</p>
25
26 {{range .Inputs}}{{$input := .}}
27 <label>{{.Name}}{{if .Required}} <span class="muted">required</span>{{end}}
28 {{if eq .Type "choice"}}
29 <select name="{{.Name}}">
30 {{range .Options}}<option value="{{.}}"{{if eq . $input.Default}} selected{{end}}>{{.}}</option>{{end}}
31 </select>
32 {{else if eq .Type "boolean"}}
33 <select name="{{.Name}}">
34 <option value="false"{{if eq .Default "false"}} selected{{end}}>false</option>
35 <option value="true"{{if eq .Default "true"}} selected{{end}}>true</option>
36 </select>
37 {{else}}
38 <input type="text" name="{{.Name}}" value="{{.Default}}"{{if .Required}} required{{end}}>
39 {{end}}
40 </label>
41 {{if .Description}}<p class="muted">{{.Description}}</p>{{end}}
42 {{end}}
43 </div>
44 <div class="form-actions">
45 <a class="button secondary" href="/r/{{.Name}}/workflows">{{icon "x"}}Cancel</a>
46 <button type="submit">{{icon "play"}}Run workflow</button>
47 </div>
48 </form>
49 {{else}}
50 <div class="empty-state">
51 <p>No workflow was selected.</p>
52 </div>
53 {{end}}
54 {{template "footer" .}}
55 {{end}}