Closed
feat(actions): 支持 获取指定 Runner Group 的详细信息 API #435
aflyingtoAdd on Jul 9Closed at Jul 13
aflyingto
Jul 13 Comments:
Jul 13 Comments:
验证记录
- 当前版本或分支: main @ 6def178(gc 0.7.0+)
- 验证方式: 通过
gc api直接调用 API 端点确认可达 - 复现命令:
gc api --method GET "/api/v8/orgs/infra-test/actions/runner-groups/nonexistent-rg-id" - 实际结果: HTTP 404
Runner Group not found: nonexistent-rg-id— API 端点可达,对不存在的 runner group id 返回 404(预期) - API 规格:
GET /api/v8/orgs/{org}/actions/runner-groups/{runner_group_id},返回 RunnerGroupDetail(runner_group_id/runner_group_name/share_all/share_all_public_repos/explicit_shared_repo_count/created_at/updated_at) - 结论: 需求有效,API 可达,进入修复


背景
GitCode API 文档 2.0.0 已提供 Actions API。该 Issue 用于跟踪 gitcode-cli 对此接口的支持设计与实现。
API 摘要
GET/api/v8/orgs/{org}/actions/runner-groups/{runner_group_id}get_api_v8_orgs_{org}_actions_runner_groups_{runner_group_id}pipeline-v8falseRequest Parameters
orgrunner_group_idaccess_tokenRequest Body
无。
Responses
200
application/jsonapplication/json schema
{ "type": "object", "properties": { "runner_group_id": { "type": "string", "description": "Runner Group ID" }, "runner_group_name": { "type": "string", "description": "Runner Group 名称" }, "share_all": { "type": "boolean", "description": "是否分享给全部仓库" }, "share_all_public_repos": { "type": "boolean", "description": "是否分享给全部公开仓库" }, "explicit_shared_repo_count": { "type": "integer", "description": "显式分享仓库数量" }, "created_at": { "type": "integer", "description": "创建时间" }, "updated_at": { "type": "integer", "description": "更新时间" } }, "description": "com.gitcode.openapi.pojo.action.runner.BizRunnerGroupDetailResp" }原始 OpenAPI Operation
{ "deprecated": false, "description": "", "operationId": "get_api_v8_orgs_{org}_actions_runner_groups_{runner_group_id}", "tags": [ "pipeline-v8" ], "parameters": [ { "name": "org", "in": "path", "description": "组织path", "required": true, "schema": { "type": "string" } }, { "name": "runner_group_id", "in": "path", "description": "", "required": true, "schema": { "type": "string" } }, { "name": "access_token", "in": "query", "description": "", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "runner_group_id": { "type": "string", "description": "Runner Group ID" }, "runner_group_name": { "type": "string", "description": "Runner Group 名称" }, "share_all": { "type": "boolean", "description": "是否分享给全部仓库" }, "share_all_public_repos": { "type": "boolean", "description": "是否分享给全部公开仓库" }, "explicit_shared_repo_count": { "type": "integer", "description": "显式分享仓库数量" }, "created_at": { "type": "integer", "description": "创建时间" }, "updated_at": { "type": "integer", "description": "更新时间" } }, "description": "com.gitcode.openapi.pojo.action.runner.BizRunnerGroupDetailResp" } } }, "headers": {} } }, "security": [], "method": "get", "path": "/api/v8/orgs/{org}/actions/runner-groups/{runner_group_id}", "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", ":runner_group_id" ], "host": [ "{{baseUrl}}" ], "query": [ { "disabled": false, "description": { "content": "(Required) ", "type": "text/plain" }, "key": "access_token", "value": "" } ], "variable": [ { "disabled": false, "description": { "content": "(Required) 组织path", "type": "text/plain" }, "type": "any", "value": "", "key": "org" }, { "disabled": false, "description": { "content": "(Required) ", "type": "text/plain" }, "type": "any", "value": "", "key": "runner_group_id" } ] }, "header": [ { "key": "Accept", "value": "application/json" } ], "method": "GET" } }初步验收建议
infra-test/*仓库。access_token仅作为 API 参数记录,CLI 优先复用现有认证机制。