diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index fe13f85df4..3b66d02fba 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -1177,7 +1177,7 @@ func Routes() *web.Route { }) m.Group("/workflows", func() { - m.Group("/{workflowname}", func() { + m.Group("/{workflowfilename}", func() { m.Post("/dispatches", reqToken(), reqRepoWriter(unit.TypeActions), mustNotBeArchived, bind(api.DispatchWorkflowOption{}), repo.DispatchWorkflow) }) }) diff --git a/routers/api/v1/repo/action.go b/routers/api/v1/repo/action.go index dbc4933de6..fe29d534ff 100644 --- a/routers/api/v1/repo/action.go +++ b/routers/api/v1/repo/action.go @@ -615,7 +615,7 @@ func ListActionTasks(ctx *context.APIContext) { // DispatchWorkflow dispatches a workflow func DispatchWorkflow(ctx *context.APIContext) { - // swagger:operation POST /repos/{owner}/{repo}/actions/workflows/{workflowname}/dispatches repository DispatchWorkflow + // swagger:operation POST /repos/{owner}/{repo}/actions/workflows/{workflowfilename}/dispatches repository DispatchWorkflow // --- // summary: Dispatches a workflow // consumes: @@ -631,7 +631,7 @@ func DispatchWorkflow(ctx *context.APIContext) { // description: name of the repo // type: string // required: true - // - name: workflowname + // - name: workflowfilename // in: path // description: name of the workflow // type: string @@ -649,13 +649,13 @@ func DispatchWorkflow(ctx *context.APIContext) { // "$ref": "#/responses/notFound" opt := web.GetForm(ctx).(*api.DispatchWorkflowOption) - name := ctx.Params("workflowname") + name := ctx.Params("workflowfilename") if len(opt.Ref) == 0 { ctx.Error(http.StatusBadRequest, "ref", "ref is empty") return } else if len(name) == 0 { - ctx.Error(http.StatusBadRequest, "workflowname", "workflow name is empty") + ctx.Error(http.StatusBadRequest, "workflowfilename", "workflow file name is empty") return } diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 0e8382b8ab..ee5e919757 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -5533,7 +5533,7 @@ } } }, - "/repos/{owner}/{repo}/actions/workflows/{workflowname}/dispatches": { + "/repos/{owner}/{repo}/actions/workflows/{workflowfilename}/dispatches": { "post": { "consumes": [ "application/json" @@ -5561,7 +5561,7 @@ { "type": "string", "description": "name of the workflow", - "name": "workflowname", + "name": "workflowfilename", "in": "path", "required": true },