feat(api): return run info for dispatched workflows (#7193)
- When the API endpoint `/repos/{owner}/{repo}/actions/workflows/{workflowname}/dispatches` is used to launch a workflow, it currently returns no data; `/repos/{owner}/{repo}/actions/tasks` can be used to track the progress of a workflow, but you need at least that workflow's run_id and the quantity of its child jobs. Tracking workflow progress is especially important if you want to chain together multiple workflows that exist within different repositories, which is desired for https://codeberg.org/forgejo/forgejo/issues/6312. - Make it possible to track the progress of manually triggered workflows by modifying the `/repos/{owner}/{repo}/actions/workflows/{workflowname}/dispatches` to return a JSON object containing the triggered workflow's id and a list of its child job names. Co-authored-by: Andrii Chyrva <achyrva@amcbridge.com> Co-authored-by: Andrii Chyrva <andrii.s.chyrva@hotmail.com> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7193 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: markturney <markturney@gmail.com> Co-committed-by: markturney <markturney@gmail.com>
This commit is contained in:
parent
c7cb5f9978
commit
7a19d3c2be
7 changed files with 88 additions and 13 deletions
33
templates/swagger/v1_json.tmpl
generated
33
templates/swagger/v1_json.tmpl
generated
|
@ -23128,6 +23128,33 @@
|
|||
"description": "Git reference for the workflow",
|
||||
"type": "string",
|
||||
"x-go-name": "Ref"
|
||||
},
|
||||
"return_run_info": {
|
||||
"description": "Flag to return the run info",
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"x-go-name": "ReturnRunInfo"
|
||||
}
|
||||
},
|
||||
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||
},
|
||||
"DispatchWorkflowRun": {
|
||||
"description": "DispatchWorkflowRun represents a workflow run",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "the workflow run id",
|
||||
"type": "integer",
|
||||
"format": "int64",
|
||||
"x-go-name": "ID"
|
||||
},
|
||||
"jobs": {
|
||||
"description": "the jobs name",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"x-go-name": "Jobs"
|
||||
}
|
||||
},
|
||||
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||
|
@ -28511,6 +28538,12 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"DispatchWorkflowRun": {
|
||||
"description": "DispatchWorkflowRun is a Workflow Run after dispatching",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/DispatchWorkflowRun"
|
||||
}
|
||||
},
|
||||
"EmailList": {
|
||||
"description": "EmailList",
|
||||
"schema": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue