有一种方法可以说:“即使其组成的工作之一成功地解决了这个阶段,这阶段已经完全成功了”?
come以“成功”的阶段结果的任何方法,即使有一个成员的工作报告为“成功”?
。Stagea是成功的,整个构建都是成功的。
- powershell: | # Define parameters $organization = "testorg" $project = "testproject" # Base64-encode the personal access token $base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":$(token)")) # Define the API URL $uri = "https://dev.azure.com/$organization/$project/_apis/build/builds/$(Build.BuildId)" + "?api-version=7.1" echo $uri # Define the body of the request $body = @{ status = "completed" result = "succeeded" } | ConvertTo-Json # Make the API request $response = Invoke-RestMethod -Uri $uri -Method Patch -Body $body -ContentType "application/json" -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)} # Output the response $response