Multiline `script:` is running without errexit?

This is by design.
User commands run without errexit – because, by necessity, they are run with eval in the same shell as other build logic (so that environment changes they make are seen by further commands), so errexit would break the enveloping internal logic.

You have a few options here:

  • Put the commands into a separate script and run it (with -e or whatever), as a subprocess.

  • Invoke consecutive commands as

    cmd1 && \
    cmd2 && \
    etc
    

    so that the status of the first failed command propagates to exit status of the entire if compound command.

  • Run the block in a subshell with -e:

    - |
      (set -e
       <etc>
      )