diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index 96ec9fd4..e13321ec 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -269,6 +269,7 @@ jobs: artifact-id: ${{ steps.upload.outputs.artifact-id }} plugin-cache-dir: ${{ steps.mkdir.outputs.plugin-cache-dir }} cache-primary-key: ${{ steps.cache-restore.outputs.cache-primary-key }} + cache-restore-hit: ${{ steps.cache-restore.outputs.cache-hit }} cache-save-outcome: ${{ steps.cache-save.outcome }} terraform-apply: @@ -298,7 +299,7 @@ jobs: path: ${{ inputs.working_directory }} - name: Restore cache - if: needs.terraform-plan.outputs.cache-save-outcome == 'success' + if: needs.terraform-plan.outputs.cache-restore-hit == 'true' || needs.terraform-plan.outputs.cache-save-outcome == 'success' uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 with: path: ${{ needs.terraform-plan.outputs.plugin-cache-dir }}