File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 95
95
cancelTimeoutInMinutes : 5
96
96
steps :
97
97
- powershell : |
98
- Write-Error "Stopping because commit message contains ***NO_CI***."
98
+ Write-Host "Stopping because commit message contains ***NO_CI***."
99
+ $uri = "https://dev.azure.com/microsoft/ReactNative/_apis/build/builds/$(Build.BuildId)?api-version=5.1"
100
+ $json = @{status="Cancelling"} | ConvertTo-Json -Compress
101
+ $build = Invoke-RestMethod -Uri $uri -Method Patch -Headers @{Authorization = "Bearer $(System.AccessToken)"} -ContentType "application/json" -Body $json
102
+ Write-Host $build
103
+ Write-Host "Waiting 60 seconds for build cancellation..."
104
+ Start-Sleep -Seconds 60
99
105
displayName: Stop pipeline if latest commit message contains ***NO_CI***
100
106
condition: and(${{ parameters.stopOnNoCI }}, contains(variables['Build.SourceVersionMessage'], '***NO_CI***'))
101
107
You can’t perform that action at this time.
0 commit comments