Skip to content

Commit bd073b2

Browse files
authored
Update test-changed-firestore-integration.yml (#7708)
1 parent 698eeb6 commit bd073b2

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

.github/workflows/test-changed-firestore-integration.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
- uses: 'google-github-actions/auth@v0'
1717
with:
1818
credentials_json: '${{ secrets.JSSDK_ACTIONS_SA_KEY }}'
19+
1920
# create composite indexes with Terraform
2021
- name: Setup Terraform
2122
uses: hashicorp/setup-terraform@v2
@@ -29,8 +30,21 @@ jobs:
2930
if: github.event_name == 'pull_request'
3031
run: |
3132
cd packages/firestore
32-
terraform apply -var-file=../../config/project.json -auto-approve &> /dev/null
33+
34+
# Define a temporary file, redirect both stdout and stderr to it
35+
output_file=$(mktemp)
36+
if ! terraform apply -var-file=../../config/project.json -auto-approve > "$output_file" 2>&1 ; then
37+
cat "$output_file"
38+
if cat "$output_file" | grep -q "index already exists"; then
39+
echo "==================================================================================="
40+
echo -e "\e[93m\e[1mTerraform apply failed due to index already exists; We can safely ignore this error.\e[0m"
41+
echo "==================================================================================="
42+
fi
43+
exit 1
44+
fi
45+
rm -f "$output_file"
3346
continue-on-error: true
47+
3448
- name: Set up Node (16)
3549
uses: actions/setup-node@v3
3650
with:

0 commit comments

Comments
 (0)