已关闭
feat(actions): 支持 查询有权访问指定 Runner Group 的仓库列表 API #438
aflyingto创建于 7月9日关闭于 7月13日
aflyingto
7月13日 评论:
7月13日 评论:
验证记录
- 当前版本或分支: main
- 复现命令:
gc api --method GET "/api/v8/orgs/infra-test/actions/runner-groups/nonexistent-rg/shared-namespaces?per_page=10&page=1" - 实际结果: HTTP 400 Runner组不存在 — API 端点可达
- API 规格:
GET /api/v8/orgs/{org}/actions/runner-groups/{runner_group_id}/shared-namespaces,返回{total_count, shared_namespaces: [{id, runner_group_id, from_namespace_id, to_namespace_id, type, create_time}]} - 结论: 需求有效,API 可达,进入修复


背景
GitCode API 文档 2.0.0 已提供 Actions API。该 Issue 用于跟踪 gitcode-cli 对此接口的支持设计与实现。
API 摘要
GET/api/v8/orgs/{org}/actions/runner-groups/{runner_group_id}/shared-namespacesget_api_v8_orgs_{org}_actions_runner_groups_{runner_group_id}_shared_namespacespipeline-v8falseRequest Parameters
orgrunner_group_idaccess_tokenkeywordpageper_pageRequest Body
无。
Responses
200
application/jsonapplication/json schema
{ "type": "object", "properties": { "total_count": { "type": "integer", "description": "有权访问的仓库总数" }, "shared_namespaces": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "分享记录 ID" }, "runner_group_id": { "type": "string", "description": "Runner Group ID" }, "from_namespace_id": { "type": "string", "description": "来源命名空间 ID" }, "to_namespace_id": { "type": "string", "description": "目标命名空间 ID" }, "type": { "type": "string", "description": "类型" }, "create_time": { "type": "integer", "description": "创建时间" }, "update_time": { "type": "integer", "description": "更新时间" }, "namespace_id": { "type": "string", "description": "命名空间 ID" }, "name": { "type": "string", "description": "名称" }, "path": { "type": "string", "description": "路径" }, "visibility": { "type": "string", "description": "可见性,\"private\", \"public\", \"internal\"" }, "path_with_namespace": { "type": "string", "description": "完整路径" } }, "description": "有权访问的仓库列表" }, "description": "有权访问的仓库列表" } }, "description": "com.gitcode.openapi.pojo.action.runner.BizActionRunnerSharedNamespaceListResp" }原始 OpenAPI Operation
{ "deprecated": false, "description": "", "operationId": "get_api_v8_orgs_{org}_actions_runner_groups_{runner_group_id}_shared_namespaces", "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, "example": "", "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": "有权访问的仓库总数" }, "shared_namespaces": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "分享记录 ID" }, "runner_group_id": { "type": "string", "description": "Runner Group ID" }, "from_namespace_id": { "type": "string", "description": "来源命名空间 ID" }, "to_namespace_id": { "type": "string", "description": "目标命名空间 ID" }, "type": { "type": "string", "description": "类型" }, "create_time": { "type": "integer", "description": "创建时间" }, "update_time": { "type": "integer", "description": "更新时间" }, "namespace_id": { "type": "string", "description": "命名空间 ID" }, "name": { "type": "string", "description": "名称" }, "path": { "type": "string", "description": "路径" }, "visibility": { "type": "string", "description": "可见性,\"private\", \"public\", \"internal\"" }, "path_with_namespace": { "type": "string", "description": "完整路径" } }, "description": "有权访问的仓库列表" }, "description": "有权访问的仓库列表" } }, "description": "com.gitcode.openapi.pojo.action.runner.BizActionRunnerSharedNamespaceListResp" } } }, "headers": {} } }, "security": [], "method": "get", "path": "/api/v8/orgs/{org}/actions/runner-groups/{runner_group_id}/shared-namespaces", "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", "shared-namespaces" ], "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" }, { "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 优先复用现有认证机制。