Skip to content

Commit

Permalink
Refine tf state variable access.
Browse files Browse the repository at this point in the history
  • Loading branch information
johncollinson2001 authored Sep 16, 2024
1 parent 7d3c031 commit 53d5497
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:

- name: Terraform Init
run: |
BRANCH_NAME="${{ github.head_ref != '' && github.head_ref || github.ref }}"
TF_STATE_KEY="${BRANCH_NAME//\//_}.tfstate"
terraform init -backend=true -backend-config="resource_group_name=$TF_STATE_RESOURCE_GROUP" -backend-config="storage_account_name=$TF_STATE_STORAGE_ACCOUNT" -backend-config="container_name=github-actions" -backend-config="key=$TF_STATE_KEY"
working-directory: infrastructure
Expand All @@ -39,7 +40,6 @@ jobs:
ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
TF_STATE_RESOURCE_GROUP: ${{ secrets.TF_STATE_RESOURCE_GROUP }}
TF_STATE_STORAGE_ACCOUNT: ${{ secrets.TF_STATE_STORAGE_ACCOUNT }}
BRANCH_NAME: ${{ github.head_ref != '' && github.head_ref || github.ref }}

- name: Terraform Validate
run: terraform validate
Expand Down

0 comments on commit 53d5497

Please sign in to comment.