From c1486fdaa314de01c180b3a4e12424124776a7a5 Mon Sep 17 00:00:00 2001 From: Richard Kuhnt Date: Thu, 16 Feb 2017 18:28:31 +0100 Subject: [PATCH] Unstage manifests if something goes wrong --- bin/auto-pr.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/auto-pr.ps1 b/bin/auto-pr.ps1 index 9b09fe5a..c8e510e5 100644 --- a/bin/auto-pr.ps1 +++ b/bin/auto-pr.ps1 @@ -82,6 +82,7 @@ function pull_requests($json, [String]$app, [String]$upstream) if($LASTEXITCODE -gt 0) { Write-Host -f DarkRed "Push failed! (hub push origin $branch)" + execute "hub reset" return } @@ -95,6 +96,7 @@ a new version of [$app]($homepage) is available. " -b '$upstream' -h $branch if($LASTEXITCODE -gt 0) { Write-Host -f DarkRed "Pull Request failed! (hub pull-request -m 'update $app to version $version' -b '$upstream' -h $branch)" + execute "hub reset" exit 1 } } @@ -141,3 +143,4 @@ if($push -eq $true) { execute "hub checkout -f master" } +execute "hub reset"