Skip to content

Commit

Permalink
updated ci.yml to add checks for NugetAPiKey env var
Browse files Browse the repository at this point in the history
  • Loading branch information
solomiofactura committed Sep 26, 2024
1 parent 71575ed commit 709eb13
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
9 changes: 6 additions & 3 deletions .devcontainer/load-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 709eb13

Please sign in to comment.