Skip to content

Commit

Permalink
Cache key should be unique per workspace (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
brettcurtis authored Mar 27, 2023
1 parent a354581 commit a94f1bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/plan-and-apply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ jobs:
service_account: ${{ inputs.service_account }}
workload_identity_provider: ${{ inputs.workload_identity_provider }}

# GitHub - Setup SSH for Module Access
# GitHub - Setup SSH for private module access
# Uncomment if you have private modules

# - name: Step ssh for private module access
# - name: Private module access
# run: |
# ssh-agent -a $SSH_AUTH_SOCK
# mkdir -p ~/.ssh
Expand All @@ -98,12 +98,12 @@ jobs:
${{ inputs.working_directory }}/.terraform
${{ inputs.working_directory }}/.terraform.lock.hcl
${{ inputs.working_directory }}/plan.out.gpg
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
key: ${{ inputs.terraform_workspace }}-${{ github.run_id }}-${{ github.run_attempt }}

# HashiCorp - Setup Terraform
# https://github.com/marketplace/actions/hashicorp-setup-terraform

- name: Setup Terraform
- name: Terraform setup
uses: hashicorp/[email protected]
with:
terraform_version: ${{ inputs.terraform_version }}
Expand Down Expand Up @@ -180,10 +180,10 @@ jobs:
service_account: ${{ inputs.service_account }}
workload_identity_provider: ${{ inputs.workload_identity_provider }}

# GitHub - Setup SSH for Module Access
# GitHub - Setup SSH for private module access
# Uncomment if you have private modules

# - name: Step ssh for private module access
# - name: Private module access
# run: |
# ssh-agent -a $SSH_AUTH_SOCK
# mkdir -p ~/.ssh
Expand All @@ -200,7 +200,7 @@ jobs:
${{ inputs.working_directory }}/.terraform
${{ inputs.working_directory }}/.terraform.lock.hcl
${{ inputs.working_directory }}/plan.out.gpg
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
key: ${{ inputs.terraform_workspace }}-${{ github.run_id }}-${{ github.run_attempt }}

# Decrypt - Terraform plan.out

Expand All @@ -210,7 +210,7 @@ jobs:
# HashiCorp - Setup Terraform
# https://github.com/marketplace/actions/hashicorp-setup-terraform

- name: Setup Terraform
- name: Terraform setup
uses: hashicorp/[email protected]
with:
terraform_version: ${{ inputs.terraform_version }}
Expand Down
2 changes: 1 addition & 1 deletion test/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module "test" {

labels = {
environment = "sandbox"
test = "xx"
test = "foo"
}

prefix = "testing"
Expand Down

0 comments on commit a94f1bd

Please sign in to comment.