【发布时间】:2020-04-23 13:38:29
【问题描述】:
我正在构建一个基于 documentation 的 JSON 正文。它看起来像这样(从文档中复制):
{
"definitionId": 1,
"description": "Creating Sample release",
"artifacts": [
{
"alias": "Fabrikam.CI",
"instanceReference": {
"id": "2",
"name": null
}
}
],
"isDraft": false,
"reason": "none",
"manualEnvironments": null
}
但是,此版本没有任何工件。这只是需要运行的阶段。我尝试将“工件”值设置为 null 和 false。我还尝试完全删除“artifacts”键,如下所示:
{
"definitionId": 1,
"description": "Creating Sample release",
"isDraft": false,
"reason": "none",
"manualEnvironments": null
}
不幸的是,所有这些猜测都只是抛出以下错误之一:
The artifact alias cannot be empty. Specify a valid artifact alias and try again.
或
Release pipeline name cannot be empty. Specify a name and try again.
如何使用 REST API 创建不包含工件的版本?
【问题讨论】:
-
如果我的回答解决了您的问题,您可以 Accept it as an Answer ,这样可以帮助遇到相同问题的其他社区成员,我们可以存档此线程,谢谢。如果没有,请让我们知道您是否需要进一步的帮助。只是提醒this。
标签: azure-devops azure-pipelines azure-devops-rest-api