mar*_*ark 4 azure-devops azure-devops-rest-api
所以,这是我所知道的:
logs带有 url 的属性。##[error]对应于构建摘要页面上记录的错误。我很好奇如果我只需要获取构建错误,这是否是最好的方法。我不需要整个日志。
您还可以使用构建时间线 API并检查结果是否存在错误。
API 响应包含 property issues,因此只需检查它是否不为 null 并打印问题消息。
例如(在 PowerShell 中):
# Get here the response from the api
$response = Invoke-RestMethod ......
$errors = $response.records.Where({ $_.issues -ne $null })
$errors.ForEach({
# Task name
$_.name
# Error message
$_.issues.ForEach({ $_.message })
})
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1187 次 |
| 最近记录: |