diff --git a/.github/workflows/terraform_apply.yaml b/.github/workflows/terraform_apply.yaml index 16bb75e..5b5ebeb 100644 --- a/.github/workflows/terraform_apply.yaml +++ b/.github/workflows/terraform_apply.yaml @@ -18,6 +18,10 @@ jobs: # This workflow contains a single job called "build" Plan: # The type of runner that the job will run on + outputs: + commit_sha: "${{ steps.git_show.utputs.commit_sha }}" + cache_key: ${{ steps.terraform_init.outputs.s3_upload_path }} + runs-on: ["229685449397"] env: @@ -34,7 +38,10 @@ jobs: persist-credentials: false - name: git show - run: echo "commit_sha=$(git show | grep commit | head -1 | awk '{ print $NF }')" >> $GITHUB_ENV + id: git_show + run: | + echo "commit_sha=$(git show | grep commit | head -1 | awk '{ print $NF }')" >> $GITHUB_ENV + echo "commit_sha=$(git show | grep commit | head -1 | awk '{ print $NF }')" >> $GITHUB_OUTPUT - name: AWS Auth id: aws_auth @@ -115,7 +122,7 @@ jobs: varfile: varfiles/${{ vars.terraform_workspace }}.tfvars download_cache: true setup_terraform: false - cache_key: ${{ steps.terraform_init.outputs.s3_upload_path }} + cache_key: ${{ needs.Plan.outputs.cache_key }} env: AWS_ACCESS_KEY_ID: ${{ steps.aws_auth.outputs.aws_access_key_id }} AWS_SECRET_ACCESS_KEY: ${{ steps.aws_auth.outputs.aws_secret_access_key }}