From 709eb13245fb14eddaff29733ee1516d6260ba0e Mon Sep 17 00:00:00 2001 From: solomiofactura Date: Thu, 26 Sep 2024 04:46:28 +0000 Subject: [PATCH] updated ci.yml to add checks for NugetAPiKey env var --- .devcontainer/load-env.sh | 9 ++++++--- .github/workflows/ci.yml | 12 +++++++----- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.devcontainer/load-env.sh b/.devcontainer/load-env.sh index ec88995..c8ba648 100644 --- a/.devcontainer/load-env.sh +++ b/.devcontainer/load-env.sh @@ -18,9 +18,12 @@ else echo "Environment file not found: $ENV_FILE_PATH" fi -# Set NugetApiKey from the environment variable -export NugetApiKey="${NugetApiKey:-}" # Keep existing value or set it to empty if not set -echo "Debug: Attempting to set NugetApiKey from environment: $NugetApiKey" # Debug output +# Ensure NugetApiKey is set from the environment variable +if [ -z "$NugetApiKey" ]; then + echo "Warning: NugetApiKey is not set. Please check your GitHub Actions secrets." +else + echo "NugetApiKey is set successfully." +fi # Print the important variables echo "Current Environment Variables:" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 91cb884..93983da 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,10 +13,12 @@ jobs: - name: Checkout code uses: actions/checkout@v2 + - name: Set NugetApiKey environment variable + run: echo "NugetApiKey: ${{ secrets.TRI_MONTHLY_TEMPO }}" + env: + NugetApiKey: ${{ secrets.TRI_MONTHLY_TEMPO }} + - name: Set up environment env: - NugetApiKey: ${{ secrets.TRI_MONTHLY_TEMPO }} # Access the secret here - run: | - echo "Running load-env.sh script with NugetApiKey" - echo "NugetApiKey is set to: $NugetApiKey" # Avoid printing the actual secret in logs - bash /workspaces/PersistedAssemblyBuilder.ConsoleApp/.devcontainer/load-env.sh + NugetApiKey: ${{ secrets.TRI_MONTHLY_TEMPO }} + run: bash /workspaces/PersistedAssemblyBuilder.ConsoleApp/.devcontainer/load-env.sh