Don’t set errexit in the main shell. This shell also runs the build’s internal logic and the sudden exit terminates it abnormally.
If a failing command should terminate the build, put it into a section other than script: – i.e. install. The script: section is designed to run tests – i.e. stuff that you want to run to completion even if something fails.