Merge pull request #20 from actions/v-malob/fix-failed-notifications

Cancel builds if new versions are not found instead of failures
pull/22/head
Maxim Lobanov 4 years ago committed by GitHub
commit 5f0e0eebc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -5,7 +5,15 @@ steps:
inputs:
TargetType: inline
script: |
throw "No new versions were found"
Write-Host "No new versions were found"
Import-Module "./azure-devops/azure-devops-api.ps1"
$azureDevOpsApi = Get-AzureDevOpsApi -TeamFoundationCollectionUri $(System.TeamFoundationCollectionUri) `
-ProjectName $(System.TeamProject) `
-AccessToken $(System.AccessToken)
$AzureDevOpsApi.UpdateBuildStatus($(Build.BuildId), 'Cancelling') | Out-Null
Start-Sleep -Seconds 60
- task: PowerShell@2
displayName: 'Set PIPELINE_URL variable'

Loading…
Cancel
Save