This commit is contained in:
leehk 2025-04-16 14:09:01 +08:00
parent 1680455a1a
commit b3470e0eb9
2 changed files with 7 additions and 2 deletions

View File

@ -91,8 +91,8 @@ jobs:
"env": {
"ENVIRONMENT": "dev",
"TESTING": "1",
"DEEPSEEK_API_KEY": "${{ secrets.DEEPSEEK_API_KEY }}",
"TAVILY_API_KEY": "${{ secrets.TAVILY_API_KEY }}"
"DEEPSEEK_API_KEY": "",
"TAVILY_API_KEY": ""
}
},

View File

@ -35,6 +35,7 @@ on:
required: false
type: string
default: results.xml
jobs:
compose_and_test:
@ -64,8 +65,12 @@ jobs:
run: |
# Load Inputs (parse JSON strings)
$imagesJson = '${{ inputs.images }}'
$deepseekApiKey = '${{ secrets.DEEPSEEK_API_KEY }}'
$tavilyApiKey = '${{ secrets.TAVILY_API_KEY }}'
# Substitute secrets *before* parsing JSON using environment variables
# Be very careful with escaping if secrets contain special JSON characters
$imagesJson = $imagesJson -replace '"DEEPSEEK_API_KEY": ""', "`"DEEPSEEK_API_KEY`": `"$deepseekApiKey`""
$imagesJson = $imagesJson -replace '"TAVILY_API_KEY": ""', "`"TAVILY_API_KEY`": `"$tavilyApiKey`""
Write-Host "Substituted Images JSON: $imagesJson" # Debugging - remove sensitive info if public
$images = $imagesJson | ConvertFrom-Json