Skip to content

Commit

Permalink
added github workflows to use github action and secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
solomiofactura committed Sep 26, 2024
1 parent 01734db commit e2f0760
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
11 changes: 3 additions & 8 deletions .devcontainer/load-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,9 @@ else
echo "Environment file not found: $ENV_FILE_PATH"
fi

# Prompt user to input NugetApiKey if it's not already set
if [ -z "$NugetApiKey" ]; then
read -e -p "Please enter your NugetApiKey: " NugetApiKey
export NugetApiKey
echo "NugetApiKey set."
else
echo "NugetApiKey already set."
fi
# Use the GitHub secret for NuGetApiKey
export NugetApiKey="${{ secrets.TRI_MONTHLY_TEMPO }}"
echo "NugetApiKey set from GitHub secret."

# Print the important variables
echo "Current Environment Variables:"
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: CI

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- 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

0 comments on commit e2f0760

Please sign in to comment.