Closed
feat(actions): 支持 查询指定组织下的所有 Runner Group API #434
aflyingtoAdd on Jul 9Closed at Jul 13
aflyingto
Jul 13 Comments:
Jul 13 Comments:
验证记录
- 当前版本或分支: main @ 4c69685(gc 0.7.0)
- 验证方式: 通过
gc api直接调用 API 端点确认可达 - 复现命令:
gc api --method GET "/api/v8/orgs/infra-test/actions/runner-groups?per_page=10&page=1" - 实际结果:
{"total_count":0,"runner_groups":[]}— API 端点可达,返回有效 JSON;infra-test 组织无 runner group(预期) - API 规格:
GET /api/v8/orgs/{org}/actions/runner-groups,支持 keyword/page/per_page 查询参数,返回total_count+runner_groups数组 - 结论: 需求有效,API 可达,进入修复


背景
GitCode API 文档 2.0.0 已提供 Actions API。该 Issue 用于跟踪 gitcode-cli 对此接口的支持设计与实现。
API 摘要
GET/api/v8/orgs/{org}/actions/runner-groupsget_api_v8_orgs_{org}_actions_runner_groupspipeline-v8falseRequest Parameters
orgaccess_tokenkeywordpageper_pageRequest Body
无。
Responses
200
application/jsonapplication/json schema
{ "type": "object", "properties": { "total_count": { "type": "integer", "description": "Runner Group 总数" }, "runner_groups": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Runner Group ID" }, "name": { "type": "string", "description": "名称" }, "runner_group_name": { "type": "string", "description": "Runner Group 名称" }, "namespace_id": { "type": "string", "description": "命名空间 ID" }, "creator": { "type": "string", "description": "创建人" }, "create_time": { "type": "integer", "description": "创建时间" }, "runner_count": { "type": "integer", "description": "Runner 数量" }, "namespace_type": { "type": "string", "description": "命名空间类型" }, "share_all": { "type": "boolean", "description": "是否分享给全部仓库" } }, "description": "Runner Group 列表" }, "description": "Runner Group 列表" } }, "description": "com.gitcode.openapi.pojo.action.runner.BizActionRunnerGroupListResp" }原始 OpenAPI Operation
{ "deprecated": false, "description": "", "operationId": "get_api_v8_orgs_{org}_actions_runner_groups", "tags": [ "pipeline-v8" ], "parameters": [ { "name": "org", "in": "path", "description": "组织path", "required": true, "schema": { "type": "string" } }, { "name": "access_token", "in": "query", "description": "", "required": true, "schema": { "type": "string" } }, { "name": "keyword", "in": "query", "description": "关键字过滤", "example": "", "schema": { "type": "string" } }, { "name": "page", "in": "query", "description": "当前页码", "example": 1, "schema": { "type": "integer" } }, { "name": "per_page", "in": "query", "description": "每页的项目数", "example": 10, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "total_count": { "type": "integer", "description": "Runner Group 总数" }, "runner_groups": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Runner Group ID" }, "name": { "type": "string", "description": "名称" }, "runner_group_name": { "type": "string", "description": "Runner Group 名称" }, "namespace_id": { "type": "string", "description": "命名空间 ID" }, "creator": { "type": "string", "description": "创建人" }, "create_time": { "type": "integer", "description": "创建时间" }, "runner_count": { "type": "integer", "description": "Runner 数量" }, "namespace_type": { "type": "string", "description": "命名空间类型" }, "share_all": { "type": "boolean", "description": "是否分享给全部仓库" } }, "description": "Runner Group 列表" }, "description": "Runner Group 列表" } }, "description": "com.gitcode.openapi.pojo.action.runner.BizActionRunnerGroupListResp" } } }, "headers": {} } }, "security": [], "method": "get", "path": "/api/v8/orgs/{org}/actions/runner-groups", "servers": [ { "url": "https://api.gitcode.com", "description": "正式环境" } ], "securitySchemes": {}, "info": { "title": "GicodeOpenAPI", "description": "", "version": "1.0.0" }, "postman": { "name": "查询指定组织下的所有 Runner Group", "description": { "content": "", "type": "text/plain" }, "url": { "path": [ "api", "v8", "orgs", ":org", "actions", "runner-groups" ], "host": [ "{{baseUrl}}" ], "query": [ { "disabled": false, "description": { "content": "(Required) ", "type": "text/plain" }, "key": "access_token", "value": "" }, { "disabled": false, "description": { "content": "关键字过滤", "type": "text/plain" }, "key": "keyword", "value": "" }, { "disabled": false, "description": { "content": "当前页码", "type": "text/plain" }, "key": "page", "value": "" }, { "disabled": false, "description": { "content": "每页的项目数", "type": "text/plain" }, "key": "per_page", "value": "" } ], "variable": [ { "disabled": false, "description": { "content": "(Required) 组织path", "type": "text/plain" }, "type": "any", "value": "", "key": "org" } ] }, "header": [ { "key": "Accept", "value": "application/json" } ], "method": "GET" } }初步验收建议
infra-test/*仓库。access_token仅作为 API 参数记录,CLI 优先复用现有认证机制。