已关闭
feat(actions): 支持 删除指定 Artifact API #433
aflyingto创建于  7月9日关闭于  7月13日
aflyingto成员
7月9日 创建

背景

GitCode API 文档 2.0.0 已提供 Actions API。该 Issue 用于跟踪 gitcode-cli 对此接口的支持设计与实现。

API 摘要

  • 标题: 删除指定 Artifact
  • Method: DELETE
  • Path: /api/v8/repos/{owner}/{repo}/actions/artifacts/{artifact_id}
  • Operation ID: delete_api_v8_repos_{owner}_{repo}_actions_artifacts_{artifact_id}
  • Tags: pipeline-v8
  • Deprecated: false
  • Description: 删除仓库下指定制品。

Request Parameters

Name In Required Type Description
owner path yes string 仓库所属空间地址(组织或个人的地址path)
repo path yes string 仓库路径(path)
artifact_id path yes string 制品id
access_token query yes string

Request Body

无。

Responses

204

  • Description: (empty)
  • Headers: 无
  • Content-Types: 无

原始 OpenAPI Operation

{
  "deprecated": false,
  "description": "删除仓库下指定制品。",
  "operationId": "delete_api_v8_repos_{owner}_{repo}_actions_artifacts_{artifact_id}",
  "tags": [
    "pipeline-v8"
  ],
  "parameters": [
    {
      "name": "owner",
      "in": "path",
      "description": "仓库所属空间地址(组织或个人的地址path)",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "repo",
      "in": "path",
      "description": "仓库路径(path)",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "artifact_id",
      "in": "path",
      "description": "制品id",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "access_token",
      "in": "query",
      "description": "",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "204": {
      "description": "",
      "headers": {}
    }
  },
  "security": [],
  "method": "delete",
  "path": "/api/v8/repos/{owner}/{repo}/actions/artifacts/{artifact_id}",
  "servers": [
    {
      "url": "https://api.gitcode.com",
      "description": "正式环境"
    }
  ],
  "securitySchemes": {},
  "info": {
    "title": "GicodeOpenAPI",
    "description": "",
    "version": "1.0.0"
  },
  "postman": {
    "name": "删除指定 Artifact",
    "description": {
      "content": "删除仓库下指定制品。",
      "type": "text/plain"
    },
    "url": {
      "path": [
        "api",
        "v8",
        "repos",
        ":owner",
        ":repo",
        "actions",
        "artifacts",
        ":artifact_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": "owner"
        },
        {
          "disabled": false,
          "description": {
            "content": "(Required) 仓库路径(path)",
            "type": "text/plain"
          },
          "type": "any",
          "value": "",
          "key": "repo"
        },
        {
          "disabled": false,
          "description": {
            "content": "(Required) 制品id",
            "type": "text/plain"
          },
          "type": "any",
          "value": "",
          "key": "artifact_id"
        }
      ]
    },
    "method": "DELETE"
  }
}

初步验收建议

  • 增加对应 API client/query 方法,保留 v8 路径。
  • 设计 agent-friendly 的 CLI 命令、帮助文本、JSON 输出和错误处理。
  • 单元测试覆盖参数映射、响应解析和错误路径。
  • 如做真实命令验证,只能使用 infra-test/* 仓库。
  • 不暴露或打印 token;文档中的 access_token 仅作为 API 参数记录,CLI 优先复用现有认证机制。
likedislike
Aaflyingto成员
7月9日 添加了label:risk/mediumscope/api, status/triage,type/feature
Aaflyingto成员
7月9日 关联了里程碑:Actions M2: Artifacts 管理
Aaflyingto成员
7月9日 添加了label:featurescope/actions
Aaflyingto成员
7月9日 删除了label:feature
Aaflyingto成员
7月10日 关联了pull request:feat(actions): add gc actions artifact list for repository artifacts
Aaflyingto成员
7月10日 关闭了 issue
Aaflyingto成员
7月10日 重新打开了 issue
Aaflyingto成员
7月10日 删除了label:status/triage
Aaflyingto成员
7月10日 添加了label:status/in-progress, status/verified
Aaflyingto成员
7月10日 关联了pull request:feat(actions): add gc actions artifact delete for artifact deletion
Aaflyingto成员
7月13日 关闭了 issue
Aaflyingto成员
7月13日 删除了label:status/in-progress
Aaflyingto成员
7月13日 删除了label:status/verified
Aaflyingto成员
7月13日 添加了label:status/merged