Releases

获取附件上传地址。Get asset upload URL.

为指定版本生成附件上传的预签名 URL。返回上传地址(upload_url)、过期时间及上传确认地址(verify_url)。 Generate a pre-signed URL for uploading an asset to the specified release. Returns the upload URL (upload_url), expiration time, and upload confirmation URL (verify_url). 上传流程为:先调用此接口获取上传地址,然后将文件 PUT 到上传地址,最后调用确认接口完成上传。 Upload process: first call this endpoint to get the upload URL, then PUT the file to the upload URL, and finally call the confirmation endpoint to complete the upload. 支持通过 overwrite 参数覆盖同名附件,通过 ttl 参数设置附件保留天数。 Supports overwriting assets with the same name via the overwrite parameter, and setting asset retention days via the ttl parameter. 访问令牌调用此接口需包含以下权限。Required permissions for access token. repo-release:rw

post/{repo}/-/releases/{release_id}/asset-upload-url

Request

  • Base URL: https://api.cnb.cool (the document declares no server; this is the origin it was published from)
  • URL: https://api.cnb.cool/{repo}/-/releases/{release_id}/asset-upload-url
  • Auth: API key in header Authorization

Path parameters

repostring required

不带.git后缀的仓库名称。格式:组织名称/仓库名称。Repository name without .git suffix. Format: org/repo.

release_idstring required

版本唯一标识符。Version unique identifier.

Request body

asset_namestring

附件名称。Attachment name.

overwriteboolean

是否覆盖同名附件。Whether to overwrite attachments with the same name.

sizeinteger

附件大小,单位为字节。Attachment size in bytes.

ttlinteger

附件存在时间,单位为天。Attachment retention time in days.

Response

Created

Changes

No recorded changes to this operation across all 1 revision of this API.