@@ -208,30 +208,26 @@ jobs:
208208 run : |
209209 cd infra
210210
211- # Get outputs using separate commands with proper sanitization
212- APP_NAME=$(terraform output app_service_name | sed 's/"//g' | tr -d '\n')
213- RG_NAME=$(terraform output resource_group_name | sed 's/"//g' | tr -d '\n')
214- API_URL=$(terraform output lb_api_url | sed 's/"//g' | tr -d '\n')
215-
216- # Verify outputs don't contain command strings
217- if [[ "$APP_NAME" == *"command"* || "$RG_NAME" == *"command"* || "$API_URL" == *"command"* ]]; then
218- echo "::error::Terraform outputs contain command strings!"
219- echo "APP_NAME: $APP_NAME"
220- echo "RG_NAME: $RG_NAME"
221- echo "API_URL: $API_URL"
222- exit 1
223- fi
211+ # Create a script to capture clean outputs
212+ cat << 'EOF' > get_outputs.sh
213+ #!/bin/bash
214+ {
215+ echo "app_service_name=$(terraform output -raw app_service_name | tr -d '\n')"
216+ echo "resource_group_name=$(terraform output -raw resource_group_name | tr -d '\n')"
217+ echo "lb_api_url=$(terraform output -raw lb_api_url | tr -d '\n')"
218+ } >> $GITHUB_OUTPUT
219+ EOF
224220
225- # Set outputs
226- echo "app_service_name=${APP_NAME}" >> $GITHUB_OUTPUT
227- echo "resource_group_name=${RG_NAME}" >> $GITHUB_OUTPUT
228- echo "lb_api_url=${API_URL}" >> $GITHUB_OUTPUT
221+ # Make script executable and run it
222+ chmod +x get_outputs.sh
223+ ./get_outputs.sh
229224
230- echo "✅ Verified clean outputs:"
231- echo "APP: ${APP_NAME}"
232- echo "RG: ${RG_NAME}"
233- echo "API: ${API_URL}"
234- shell : bash
225+ # Verify outputs
226+ echo "✅ Clean outputs captured:"
227+ echo "APP: ${{ steps.tf.outputs.app_service_name }}"
228+ echo "RG: ${{ steps.tf.outputs.resource_group_name }}"
229+ echo "API: ${{ steps.tf.outputs.lb_api_url }}"
230+
235231
236232 - name : Deploy Frontend
237233 run : |
0 commit comments