feat(api): return run_number in workflow dispatch (#7286)

- This is a follow up on #7193 and resolves #6312.
- The ID by itself is not very useful, so also return the index of the workflow run.

Co-authored-by: Klaus Fyhn <klausfyhn@gmail.com>
Co-authored-by: Klaus Fyhn <klfj@mir-robots.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7286
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: klausfyhn <klausfyhn@noreply.codeberg.org>
Co-committed-by: klausfyhn <klausfyhn@noreply.codeberg.org>
This commit is contained in:
klausfyhn 2025-03-25 21:22:32 +00:00 committed by Gusted
parent 513319c1ec
commit c531b8f020
4 changed files with 76 additions and 2 deletions

View file

@ -640,6 +640,8 @@ func DispatchWorkflow(ctx *context.APIContext) {
// schema:
// "$ref": "#/definitions/DispatchWorkflowOption"
// responses:
// "201":
// "$ref": "#/responses/DispatchWorkflowRun"
// "204":
// "$ref": "#/responses/empty"
// "404":
@ -681,8 +683,9 @@ func DispatchWorkflow(ctx *context.APIContext) {
}
workflowRun := &api.DispatchWorkflowRun{
ID: run.ID,
Jobs: jobs,
ID: run.ID,
RunNumber: run.Index,
Jobs: jobs,
}
if opt.ReturnRunInfo {