From 36b261c651adbdf48e6a28d5db13247fd3e7015c Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Wed, 10 Apr 2024 10:04:35 -0600 Subject: [PATCH] Fix terraform steps in CI PR #2 (#8147) Attempt to conditionally run terraform steps only if secrets are available. Add fromJSON to convert env var string value to boolean. --- .github/workflows/test-changed-firestore-integration.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-changed-firestore-integration.yml b/.github/workflows/test-changed-firestore-integration.yml index 050ea7a43f5..85e9c7e3eaa 100644 --- a/.github/workflows/test-changed-firestore-integration.yml +++ b/.github/workflows/test-changed-firestore-integration.yml @@ -34,23 +34,23 @@ jobs: # This makes Actions fetch all Git history so run-changed script can diff properly. fetch-depth: 0 - uses: 'google-github-actions/auth@v0' - if: ${{ env.run_terraform_steps }} + if: ${{ fromJSON(env.run_terraform_steps) }} with: credentials_json: '${{ secrets.JSSDK_ACTIONS_SA_KEY }}' # create composite indexes with Terraform - name: Setup Terraform - if: ${{ env.run_terraform_steps }} + if: ${{ fromJSON(env.run_terraform_steps) }} uses: hashicorp/setup-terraform@v2 - name: Terraform Init - if: ${{ env.run_terraform_steps }} + if: ${{ fromJSON(env.run_terraform_steps) }} run: | cp config/ci.config.json config/project.json cd packages/firestore terraform init continue-on-error: true - name: Terraform Apply - if: github.event_name == 'pull_request' && env.run_terraform_steps + if: github.event_name == 'pull_request' && fromJSON(env.run_terraform_steps) run: | cd packages/firestore