@@ -167,6 +167,15 @@ inputs:
167
167
description : " Leverage actions/cache to cache dependencies to speed up execution"
168
168
required : false
169
169
default : ' false'
170
+ terraform-cache-dir :
171
+ description : " allows overriding of the terraform cache dir which defaults to ${github.workspace}/cache"
172
+ required : false
173
+ default : ' '
174
+ terragrunt-cache-dir :
175
+ description : " allows overriding of the terragrunt cache dir to ${github.workspace}/cache"
176
+ required : false
177
+ default : ' '
178
+
170
179
digger-spec :
171
180
description : " (orchestrator only) the spec to pass onto digger cli"
172
181
required : false
@@ -369,9 +378,18 @@ runs:
369
378
INPUT_DRIFT_DETECTION_SLACK_NOTIFICATION_URL : ${{ inputs.drift-detection-slack-notification-url }}
370
379
NO_BACKEND : ${{ inputs.no-backend }}
371
380
DEBUG : ' true'
372
- TF_PLUGIN_CACHE_DIR : ${{ github.workspace }}/cache
381
+ # if terraform-cache-dir is set then we set it to that otherwise set it to '${{github.workspace}}/cache'
382
+ TF_PLUGIN_CACHE_DIR : ${{
383
+ inputs.terraform-cache-dir == '' &&
384
+ format('{0}/cache', github.workspace) ||
385
+ inputs.terraform-cache-dir
386
+ }}
373
387
TERRAGRUNT_PROVIDER_CACHE : ${{ inputs.cache-dependencies == 'true' && 1 || 0 }}
374
- TERRAGRUNT_PROVIDER_CACHE_DIR : ${{ github.workspace }}/cache
388
+ TERRAGRUNT_PROVIDER_CACHE_DIR : ${{
389
+ inputs.terragrunt-cache-dir == '' &&
390
+ format('{0}/cache', github.workspace) ||
391
+ inputs.terragrunt-cache-dir
392
+ }}
375
393
DIGGER_RUN_SPEC : ${{inputs.digger-spec}}
376
394
run : |
377
395
if [[ ${{ inputs.ee }} == "true" ]]; then
@@ -407,9 +425,19 @@ runs:
407
425
INPUT_DIGGER_COMMAND : ${{ inputs.command }}
408
426
INPUT_DRIFT_DETECTION_SLACK_NOTIFICATION_URL : ${{ inputs.drift-detection-slack-notification-url }}
409
427
NO_BACKEND : ${{ inputs.no-backend }}
410
- TF_PLUGIN_CACHE_DIR : ${{ github.workspace }}/cache
428
+ # if terraform-cache-dir is set then we set it to that otherwise set it to '${{github.workspace}}/cache'
429
+ TF_PLUGIN_CACHE_DIR : ${{
430
+ inputs.terraform-cache-dir == '' &&
431
+ format('{0}/cache', github.workspace) ||
432
+ inputs.terraform-cache-dir
433
+ }}
411
434
TERRAGRUNT_PROVIDER_CACHE : ${{ inputs.cache-dependencies == 'true' && 1 || 0 }}
412
- TERRAGRUNT_PROVIDER_CACHE_DIR : ${{ github.workspace }}/cache
435
+ # if terragrunt-cache-dir is set then we set it to that otherwise set it to '${{github.workspace}}/cache'
436
+ TERRAGRUNT_PROVIDER_CACHE_DIR : ${{
437
+ inputs.terragrunt-cache-dir == '' &&
438
+ format('{0}/cache', github.workspace) ||
439
+ inputs.terragrunt-cache-dir
440
+ }}
413
441
DIGGER_RUN_SPEC : ${{inputs.digger-spec}}
414
442
id : digger
415
443
shell : bash
0 commit comments