Skip to content

Commit 36f6336

Browse files
committed
feat: add caching for terragrunt
enable terragrunt provider caching, when inputs.cache-dependencies is set
1 parent 91e2117 commit 36f6336

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

action.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,8 @@ runs:
309309
NO_BACKEND: ${{ inputs.no-backend }}
310310
DEBUG: 'true'
311311
TF_PLUGIN_CACHE_DIR: ${{ github.workspace }}/cache
312+
TERRAGRUNT_PROVIDER_CACHE: ${{ inputs.cache-dependencies == 'true' && "1" || "0" }}
313+
TERRAGRUNT_PROVIDER_CACHE_DIR: ${{ github.workspace }}/cache
312314
run: |
313315
cd $GITHUB_ACTION_PATH/cli
314316
go build -o digger ./cmd/digger
@@ -336,6 +338,9 @@ runs:
336338
INPUT_DIGGER_COMMAND: ${{ inputs.command }}
337339
INPUT_DRIFT_DETECTION_SLACK_NOTIFICATION_URL: ${{ inputs.drift-detection-slack-notification-url }}
338340
NO_BACKEND: ${{ inputs.no-backend }}
341+
TF_PLUGIN_CACHE_DIR: ${{ github.workspace }}/cache
342+
TERRAGRUNT_PROVIDER_CACHE: ${{ inputs.cache-dependencies == 'true' && "1" || "0" }}
343+
TERRAGRUNT_PROVIDER_CACHE_DIR: ${{ github.workspace }}/cache
339344
id: digger
340345
shell: bash
341346
run: |
@@ -347,10 +352,12 @@ runs:
347352
348353
- uses: actions/cache/save@v4
349354
name: cache-save
355+
if: ${{ inputs.cache-dependencies == 'true' }}
350356
with:
351357
path: ${{ github.workspace }}/cache
352358
key: digger-cache-${{ hashFiles('**/cache') }}
353-
if: ${{ inputs.cache-dependencies == 'true' }}
359+
restore-keys: |
360+
digger-cache-
354361
355362
branding:
356363
icon: globe

0 commit comments

Comments
 (0)