mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
Only delete asm branches if it is the last build
This commit is contained in:
parent
3d45a84f47
commit
ddfcf070c8
11
appveyor.yml
11
appveyor.yml
@ -160,13 +160,17 @@ deploy_script:
|
|||||||
|
|
||||||
on_finish:
|
on_finish:
|
||||||
- ps: |
|
- ps: |
|
||||||
# Delete all branches for asm
|
|
||||||
if(-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER)) {
|
if(-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER)) {
|
||||||
|
# Delete all branches for asm if this is the last build
|
||||||
$build = Invoke-RestMethod -Uri "https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG" -Method GET -Headers @{
|
$build = Invoke-RestMethod -Uri "https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG" -Method GET -Headers @{
|
||||||
"Authorization" = "Bearer $env:APPVEYOR_API_TOKEN"
|
"Authorization" = "Bearer $env:APPVEYOR_API_TOKEN"
|
||||||
"Content-type" = "application/json"
|
"Content-type" = "application/json"
|
||||||
}
|
}
|
||||||
$build.build.jobs | Foreach-Object {
|
$jobs = $buildData.build.jobs
|
||||||
|
$lastJob = ($jobs | Select-Object -Last 1).jobId
|
||||||
|
|
||||||
|
if ($lastJob -eq $env:APPVEYOR_JOB_ID) {
|
||||||
|
$jobs | Foreach-Object {
|
||||||
$branchName = "asm/$($env:APPVEYOR_REPO_COMMIT)/appveyor-$($_.jobId)"
|
$branchName = "asm/$($env:APPVEYOR_REPO_COMMIT)/appveyor-$($_.jobId)"
|
||||||
git ls-remote --heads --exit-code https://github.com/dadonenf/GSL.git $branchName
|
git ls-remote --heads --exit-code https://github.com/dadonenf/GSL.git $branchName
|
||||||
if($?){
|
if($?){
|
||||||
@ -174,5 +178,4 @@ on_finish:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user