Skip to content

Commit a94f1bd

Browse files
authored
Cache key should be unique per workspace (#49)
1 parent a354581 commit a94f1bd

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

.github/workflows/plan-and-apply.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ jobs:
7878
service_account: ${{ inputs.service_account }}
7979
workload_identity_provider: ${{ inputs.workload_identity_provider }}
8080

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

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

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

106-
- name: Setup Terraform
106+
- name: Terraform setup
107107
uses: hashicorp/setup-terraform@v2.0.3
108108
with:
109109
terraform_version: ${{ inputs.terraform_version }}
@@ -180,10 +180,10 @@ jobs:
180180
service_account: ${{ inputs.service_account }}
181181
workload_identity_provider: ${{ inputs.workload_identity_provider }}
182182

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

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

205205
# Decrypt - Terraform plan.out
206206

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

213-
- name: Setup Terraform
213+
- name: Terraform setup
214214
uses: hashicorp/setup-terraform@v2.0.3
215215
with:
216216
terraform_version: ${{ inputs.terraform_version }}

test/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module "test" {
1010

1111
labels = {
1212
environment = "sandbox"
13-
test = "xx"
13+
test = "foo"
1414
}
1515

1616
prefix = "testing"

0 commit comments

Comments
 (0)