diff --git a/modules/structs/workflow.go b/modules/structs/workflow.go index f8f1e5a7a5..704ed0e65b 100644 --- a/modules/structs/workflow.go +++ b/modules/structs/workflow.go @@ -22,6 +22,8 @@ type DispatchWorkflowOption struct { type DispatchWorkflowRun struct { // the workflow run id ID int64 `json:"id"` + // a unique number for each run of a repository + RunNumber int64 `json:"run_number"` // the jobs name Jobs []string `json:"jobs"` } diff --git a/routers/api/v1/repo/action.go b/routers/api/v1/repo/action.go index a2cc70f4d7..d73a13dc11 100644 --- a/routers/api/v1/repo/action.go +++ b/routers/api/v1/repo/action.go @@ -681,8 +681,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 {