Skip to content

Commit

Permalink
Fix terraform steps in CI PR #2 (#8147)
Browse files Browse the repository at this point in the history
Attempt to conditionally run terraform steps only if secrets are available. Add fromJSON to convert env var string value to boolean.
  • Loading branch information
MarkDuckworth committed Apr 10, 2024
1 parent 0068ed5 commit 36b261c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test-changed-firestore-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 36b261c

Please sign in to comment.