tag:help.appveyor.com,2012-11-13:/discussions/problems/28242-exit-appveyorbuild-command-doesnt-work-in-if-statementAppVeyor: Discussion 2020-09-22T23:50:38Ztag:help.appveyor.com,2012-11-13:Comment/486512632020-09-22T02:05:12Z2020-09-22T02:05:12ZExit-AppVeyorBuild command doesn't work in if-statement<div><p>What was the last build it worked - could you drop a link to that build please?</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/486512632020-09-22T03:04:01Z2020-09-22T03:04:01ZExit-AppVeyorBuild command doesn't work in if-statement<div><p>Sorry, I have only private repository's build of our company account. Can you look at it?<br>
<a href="https://ci.appveyor.com/project/NozomiIto/magic-pod/builds/34305129/job/6pkvyp7llso9ofrk">https://ci.appveyor.com/project/NozomiIto/magic-pod/builds/34305129...</a></p></div>TAMAGAWA Hirokotag:help.appveyor.com,2012-11-13:Comment/486512632020-09-22T03:12:14Z2020-09-22T03:12:14ZExit-AppVeyorBuild command doesn't work in if-statement<div><p>I've attached the screenshot of the log.<br>
It looks complicated, in this case the build is stopped by this branch condition</p>
<pre>
<code>if (($env:TEST_SUITE_NO -ne 1) -And (($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "macos") -Or ($env:SKIP_TEST -eq $True))) {
Exit-AppVeyorBuild
}</code>
</pre>
<p>We have a build matrix consisting of 4 jobs (2 test suites x 2 images) to execute our tests on various browsers. Some jobs are skipped according to environment variables (ex. We sometimes skip some browsers' test).</p></div>TAMAGAWA Hirokotag:help.appveyor.com,2012-11-13:Comment/486512632020-09-22T04:14:02Z2020-09-22T04:14:02ZExit-AppVeyorBuild command doesn't work in if-statement<div><p>Oh sorry, you want the "last" one. It seems the behavior has changed around a month ago.</p>
<ul>
<li>The last successful one on our end: <a href="https://ci.appveyor.com/project/NozomiIto/magic-pod/builds/34559445">https://ci.appveyor.com/project/NozomiIto/magic-pod/builds/34559445</a> (Aug. 9th)</li>
<li>The first not successful one: <a href="https://ci.appveyor.com/project/NozomiIto/magic-pod/builds/34563439">https://ci.appveyor.com/project/NozomiIto/magic-pod/builds/34563439</a> (Aug. 10th)</li>
</ul></div>TAMAGAWA Hirokotag:help.appveyor.com,2012-11-13:Comment/486512632020-09-22T16:39:22Z2020-09-22T16:39:22ZExit-AppVeyorBuild command doesn't work in if-statement<div><p>Hi Hiroko,</p>
<p><code>Exit-AppVeyorBuild</code> must be the last command in the script to make it worked. Changing <code>init</code> section in your example to the following works:</p>
<pre>
<code>init:
- ps: >-
if ($True) {
echo "Exit"
Exit-AppVeyorBuild
} else {
git config --global core.autocrlf input
}</code>
</pre></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/486512632020-09-22T23:50:22Z2020-09-22T23:50:22ZExit-AppVeyorBuild command doesn't work in if-statement<div><p>Now I have confirmed the behavior, thank you!</p></div>TAMAGAWA Hiroko