From 8b5443acdb0aac7bb4c56faf6aad7487b82d0aa0 Mon Sep 17 00:00:00 2001 From: chesterip Date: Tue, 22 Aug 2023 20:00:59 -0400 Subject: [PATCH] Fix template --- services/convert/convert.go | 2 +- templates/swagger/v1_json.tmpl | 144 +++++++++++---------------------- 2 files changed, 46 insertions(+), 100 deletions(-) diff --git a/services/convert/convert.go b/services/convert/convert.go index 8ca215938d..e83a0067e7 100644 --- a/services/convert/convert.go +++ b/services/convert/convert.go @@ -186,7 +186,7 @@ func ToActionTask(ctx context.Context, repo *repo_model.Repository, t *actions_m log.Warn("LoadAttributes of ActionTask: %v", err) } return &api.ActionTask{ - ID: t.ID, + ID: t.Job.RunID, JobName: t.Job.Name, WorkflowID: t.Job.Run.WorkflowID, Title: t.Job.Run.Title, diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 1765879c92..35e095fd68 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -3184,6 +3184,51 @@ } } }, + "/repos/{owner}/{repo}/actions/tasks": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "List a repository's action tasks", + "operationId": "ListActionTasks", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results, default maximum page size is 50", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/TasksList" + } + } + } + }, "/repos/{owner}/{repo}/activities/feeds": { "get": { "produces": [ @@ -12313,51 +12358,6 @@ } } }, - "/repos/{owner}/{repo}/actions/tasks": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "repository" - ], - "summary": "List a repository's actions tasks", - "operationId": "ListActionTasks", - "parameters": [ - { - "type": "string", - "description": "owner of the repo", - "name": "owner", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "name of the repo", - "name": "repo", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "page number of results to return (1-based)", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "page size of results, default maximum page size is 50", - "name": "limit", - "in": "query" - } - ], - "responses": { - "200": { - "$ref": "#/responses/TasksList" - } - } - } - }, "/repos/{owner}/{repo}/teams": { "get": { "produces": [ @@ -21459,51 +21459,6 @@ }, "x-go-package": "code.gitea.io/gitea/modules/structs" }, - "Task": { - "description": "Task represents a task", - "type": "object", - "properties": { - "id": { - "type": "string", - "x-go-name": "ID" - }, - "job_name": { - "type": "string", - "x-go-name": "JobName" - }, - "workflow_id": { - "type": "string", - "x-go-name": "WorkflowID" - }, - "title": { - "type": "string", - "x-go-name": "Title" - }, - "status": { - "type": "string", - "x-go-name": "Status" - }, - "commit": { - "type": "string", - "x-go-name": "Commit" - }, - "duration": { - "type": "string", - "x-go-name": "Duration" - }, - "started": { - "type": "string", - "format": "date-time", - "x-go-name": "Started" - }, - "stopped": { - "type": "string", - "format": "date-time", - "x-go-name": "Stopped" - } - }, - "x-go-package": "code.gitea.io/gitea/modules/structs" - }, "ServerVersion": { "description": "ServerVersion wraps the version of the server", "type": "object", @@ -23090,15 +23045,6 @@ } } }, - "TasksList": { - "description": "TasksList", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Task" - } - } - }, "ServerVersion": { "description": "ServerVersion", "schema": {