diff --git a/mpsd-software-environment.py b/mpsd-software-environment.py
index 02982e8c63392a351e0f6fef809bb7c3ba248a53..ac3019fe6c6df47d9e02f09ffa8dce897929bf3a 100755
--- a/mpsd-software-environment.py
+++ b/mpsd-software-environment.py
@@ -193,6 +193,7 @@ def setup_log_cmd(
                         run(
                             ["git", "rev-parse", "--abbrev-ref", "HEAD"],
                             stdout=subprocess.PIPE,
+                            check=True,
                         )
                         .stdout.decode()
                         .strip()
@@ -201,6 +202,7 @@ def setup_log_cmd(
                         run(
                             ["git", "rev-parse", "--short", "HEAD"],
                             stdout=subprocess.PIPE,
+                            check=True,
                         )
                         .stdout.decode()
                         .strip()
@@ -250,7 +252,8 @@ def create_dir_structure(mpsd_release: str, script_dir: Path) -> None:
                     "git",
                     "clone",
                     config_vars["spack_environments_repo"],
-                ]
+                ],
+                check=True,
             )
         with os_chdir("spack-environments"):
             # Git fetch and checkout the release branch and git pull
@@ -460,6 +463,7 @@ def install_environment(
                 f"bash {spack_setup_script} {' '.join(install_flags)} {toolchain} 2>&1 "
                 f"| tee -a {install_log_file} ",
                 shell=True,
+                check=True,
             )