已关闭
feat(actions): gc actions workflow list — 列举仓库流水线 #508
aflyingto创建于  8月10日关闭于  8月12日
aflyingto成员
8月10日 创建

背景

拆自专项 issue gitcode-cli/cli#506 §3.2。对齐 gh workflow list。

API 端点(已就绪)

GET /api/v8/repos/{owner}/{repo}/actions/workflows

  • 路径参数:owner、repo
  • 查询参数:per_page(max 100, 默认 20)、page(默认 1)
  • 响应 200:
    {
      "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)列表。

命令接口

gc actions workflow list -R owner/repo [flags]

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 workflow list [--all] [--limit <int>] [--json <fields>]

gh 响应字段:id/name/path/state。gc 响应字段:workflow_id/file_path/name/state,字段语义一致。

验收标准

Refs gitcode-cli/cli#506

likedislike
Aaflyingto成员
8月10日 添加了label:agent-friendlyenhancementscope/actions
Aaflyingto成员
8月11日 关联了里程碑:gh-parity: 全面对齐 gh CLI
aflyingto成员
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 子命令。

likedislike
Aaflyingto成员
8月12日 关联了pull request:feat(actions): add gc actions workflow list — list repository workflows
Aaflyingto成员
8月12日 关闭了 issue