From 3924c4b8624e43668f20c42aba8c222fead4c2b5 Mon Sep 17 00:00:00 2001 From: Mateusz Szczygielski Date: Thu, 22 Feb 2024 13:36:18 +0100 Subject: [PATCH] Add load-env validation --- .github/workflows/load-env-subworkflow.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/load-env-subworkflow.yml b/.github/workflows/load-env-subworkflow.yml index c1887456f..95da9ab76 100644 --- a/.github/workflows/load-env-subworkflow.yml +++ b/.github/workflows/load-env-subworkflow.yml @@ -12,10 +12,20 @@ jobs: load-env: runs-on: self-hosted outputs: - optix-install-dir: ${{ steps.set-env.outputs.optix-install-dir }} - user-id: ${{ steps.set-env.outputs.user-id }} + optix-install-dir: ${{ steps.set-envs.outputs.optix-install-dir }} + user-id: ${{ steps.set-envs.outputs.user-id }} steps: - - id: set-env + - id: check-envs run: | - echo "optix-install-dir=$OptiX_INSTALL_DIR" >> $GITHUB_OUTPUT - echo "user-id=$(id -u $USER)" >> $GITHUB_OUTPUT + if [[ -z "${OptiX_INSTALL_DIR}" ]]; then + echo "OptiX_INSTALL_DIR env is empty" + exit 1 + fi + if [[ -z "$(id -u $USER)" ]]; then + echo "Cannot deduce id of the USER" + exit 1 + fi + - id: set-envs + run: | + echo "optix-install-dir=$OptiX_INSTALL_DIR" | tee -a $GITHUB_OUTPUT + echo "user-id=$(id -u $USER)" | tee -a $GITHUB_OUTPUT