Skip to content

Commit 70b38d3

Browse files
committed
fixed command outputs and terraform formats
1 parent d894a2f commit 70b38d3

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

.github/workflows/terraform.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -208,25 +208,25 @@ jobs:
208208
run: |
209209
cd infra
210210
211-
# Create a script to capture clean outputs
212-
cat << 'EOF' > get_outputs.sh
213-
#!/bin/bash
211+
# Create a clean environment file
214212
{
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
213+
echo "app_service_name=$(terraform output -raw app_service_name | tr -d '\n')"
214+
echo "resource_group_name=$(terraform output -raw resource_group_name | tr -d '\n')"
215+
echo "lb_api_url=$(terraform output -raw lb_api_url | tr -d '\n')"
216+
} > terraform_outputs.env
217+
218+
# Load the clean outputs
219+
source terraform_outputs.env
220220
221-
# Make script executable and run it
222-
chmod +x get_outputs.sh
223-
./get_outputs.sh
221+
# Set GitHub outputs
222+
echo "app_service_name=${app_service_name}" >> $GITHUB_OUTPUT
223+
echo "resource_group_name=${resource_group_name}" >> $GITHUB_OUTPUT
224+
echo "lb_api_url=${lb_api_url}" >> $GITHUB_OUTPUT
224225
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 }}"
226+
echo "✅ Verified outputs:"
227+
echo "APP: ${app_service_name}"
228+
echo "RG: ${resource_group_name}"
229+
echo "API: ${lb_api_url}"
230230
231231
232232
- name: Deploy Frontend

0 commit comments

Comments
 (0)