已关闭
feat(actions): gc actions workflow list — 列举仓库流水线 #508
aflyingto创建于 8月10日关闭于 8月12日
aflyingto
8月12日 评论:
8月12日 评论:
验证记录
验证版本: main (231d4fc)
验证命令: gc actions workflow --help + 源码审查
验证结果:
- gc actions workflow 命令不存在(无 workflow 子命令组)
- API 端点已就绪:GET /api/v8/repos/{owner}/{repo}/actions/workflows
- 响应结构:{total_count, workflows: [{workflow_id, file_path, name, state}]}
- 现有 ListActionsRuns 使用 RawREST + v8 路径模式可参考
- actions.go 已有 7 个子命令组(run/job/artifact/runner-group/runner/runner-set/yaml)
结论: 确认功能缺失,API 就绪,需新增 workflow 命令组 + list 子命令。


背景
拆自专项 issue gitcode-cli/cli#506 §3.2。对齐
gh workflow list。API 端点(已就绪)
GET /api/v8/repos/{owner}/{repo}/actions/workflowsowner、repoper_page(max 100, 默认 20)、page(默认 1){ "total_count": 0, "workflows": [ { "workflow_id": "string", "file_path": "string", "name": "string", "state": "string" } ] }API 文档:
api-doc/docs/api/actions/get-api-v8-repos-owner-repo-actions-workflows.md需求
新增
gc actions workflow list子命令,列举仓库的流水线(workflow)列表。命令接口
Flags:
-L, --limit <int>:最大返回数,默认 30--page <int>:页码--paginate:拉取全部页--per-page <int>:API page size-R, --repo:仓库--json:JSON 输出--format:输出格式(json/simple/table)新增代码
api/queries_actions.go:新增Workflow类型、WorkflowsResponse、ListActionsWorkflows函数pkg/cmd/actions/workflow/workflow.go:新增workflow命令组pkg/cmd/actions/workflow/list/list.go:list 子命令pkg/output/workflows.go:列表 printer对齐 gh 参考
gh 响应字段:id/name/path/state。gc 响应字段:workflow_id/file_path/name/state,字段语义一致。
验收标准
Refs gitcode-cli/cli#506