@@ -69,13 +69,15 @@ jobs:
6969 env :
7070 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
7171
72- - name : " Upload Terraform Plan as Artifact"
73- uses : actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0
72+ - name : Upload Terraform Plan as Artifact
73+ uses : pagopa/dx/actions/terraform-plan-upload@main
74+ env :
75+ ARTIFACT_ENC_KEY : ${{ secrets.ARTIFACT_ENC_KEY }}
7476 with :
75- name : tfplan
76- path : ${{ inputs.dir }}/tfplan-${{ env.TERRAFORM_ENVIRONMENT }}-${{ github.sha }}
77- if-no-files-found : error
78- retention-days : 14
77+ plan-file : tfplan-${{ env.TERRAFORM_ENVIRONMENT }}-${{ github.sha }}
78+ working-directory : ${{ inputs.dir }}
79+ artifact-name : terraform-plan
80+ retention-days : 1
7981
8082 apply :
8183 name : ' Terraform Apply'
@@ -100,12 +102,15 @@ jobs:
100102 client-id : ${{ secrets.ARM_CLIENT_ID }}
101103 tenant-id : ${{ vars.ARM_TENANT_ID }}
102104 subscription-id : ${{ vars.ARM_SUBSCRIPTION_ID }}
103-
105+
104106 - name : Download Terraform Plan as Artifact
105- uses : actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
107+ uses : pagopa/dx/actions/terraform-plan-download@main
108+ env :
109+ ARTIFACT_ENC_KEY : ${{ secrets.ARTIFACT_ENC_KEY }}
106110 with :
107- name : tfplan
108- path : ${{ inputs.dir }}
111+ plan-file : tfplan-${{ env.TERRAFORM_ENVIRONMENT }}-${{ github.sha }}
112+ working-directory : ${{ inputs.dir }}
113+ artifact-name : terraform-plan
109114
110115 - name : Retrieve Terraform Modules from Cache
111116 id : cache-terraform-modules
0 commit comments