mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 19:11:25 +01:00
feat(workflow): address workflows by name and check dispatch inputs
Workflows are found by file name, file name without extension, path or name, case-insensitively, with the candidates listed when a name is ambiguous. workflow list shows a NAME, FILE and STATE table, and workflow view shows the workflow with its last runs, prints its file with --yaml (at --ref) or opens it with --web. workflow run reads the workflow_dispatch inputs of the workflow at the ref and refuses unknown inputs, missing required inputs and values a choice, boolean or number input does not accept, before dispatching. In a terminal it asks for missing inputs, or all of them when none is given. Without --ref it uses the checked-out branch, which must be on the server, or the default branch when the repository does not come from the working directory. It reports "Dispatched CI (ci.yml) on main → run 33" with the command to watch it, prints the run's URL, and --follow follows the logs of all jobs within --timeout. workflow enable and disable no longer ask for confirmation, report the change, warn when there is nothing to do, and return the workflow with --json. Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
4 files changed
+737
-143
No files matched your search
@@ -245,7 +245,7 @@ func TestUsageErrorsPrecedeRequests(t *testing.T) {
|
||||
{[]string{"wiki", "create", "--title", "Home", "--body", "text", "--json=created_at"}, "unknown JSON field \"created_at\""},
|
||||
{[]string{"wiki", "edit", "Home", "--body="}, "wiki content cannot be empty"},
|
||||
{[]string{"wiki", "revisions", "Home", "--page", "0"}, `"--page" flag: must be a positive integer`},
|
||||
{[]string{"workflow", "run", "ci.yml", "-r", "main", "-f", "a=1", "-i", "a=2"}, "duplicate workflow input"},
|
||||
{[]string{"workflow", "run", "ci.yml", "-r", "main", "-f", "a=1", "-i", "a=2"}, "input a is given more than once"},
|
||||
} {
|
||||
t.Run(strings.Join(tc.args, " "), func(t *testing.T) {
|
||||
requireUsageBeforeRequests(t, tc.want, tc.args...)
|
||||
|
||||
Reference in new issue
Block a user