我正在尝试使用此 API 端点创建新的管道:
POST https://dev.azure.com/{organization}/{project}/_apis/pipelines?api-version=6.0-preview.1
这是我正在使用的请求:
curl -X POST
'https://dev.azure.com/<myorg>/<myproj>/_apis/pipelines?api-version=6.0-preview.1'
-H 'Authorization: Basic <b64string>'
-H 'Cache-Control: no-cache'
-H 'Content-Type: application/json'
-d '{
"configuration":{
"repository": {
"id": "<repo-guid>",
"name": "<repo-name>",
"type": "azureReposGit"
},
"path": "pipeline.yaml",
"type": "yaml"
},
"folder": "\custompath\",
"name": "<pipelinename>"
}
我不断收到相同的错误:
{
"$id": "1",
"innerException": null,
"message": "Value cannot be null.rnParameter name: repositoryName",
"typeName": "System.ArgumentNullException, mscorlib",
"typeKey": "ArgumentNullException",
"errorCode": 0,
"eventId": 0
}
这似乎是我的有效载荷的问题,但文档对此不是很有帮助 https://learn.microsoft.com/en-us/rest/api/azure/devops/pipelines/pipelines/create?view=azure-devops-rest-6.0
当前版本 o nodejs sdk 尚不支持 Pipeline API。谁能帮我?
我能够在我这边重现您的问题,并在下面的网站上报告了此问题:
https://developercommunity.visualstudio.com/content/problem/1101376/create-pipeline-rest-api-does-not-work.html
产品团队已提供响应:">已准备好此问题的修复程序。它应该在接下来的 3 周内发布给所有人。">