Skip to content

Commit

Permalink
fix(test): simplify cache key creation
Browse files Browse the repository at this point in the history
  • Loading branch information
yohanb committed Dec 9, 2024
1 parent 711c4d9 commit 97b6924
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,13 @@ runs:
- name: Configure Terraform plugin cache
shell: bash
run: |
echo "TF_PLUGIN_CACHE_DIR=${{ runner.temp }}/.terraform.d/plugin-cache" >>"$GITHUB_ENV"
mkdir --parents "${{ runner.temp }}.terraform.d/plugin-cache"
- name: Check for terraform lockfiles
id: check_terraform_lockfiles
if: inputs.s3-bucket-name != ''
uses: andstor/file-existence-action@v3
with:
files: "**/.terraform.lock.hcl"
echo "TF_PLUGIN_CACHE_DIR=${{ runner.temp }}/.terraform.d/plugin-cache" >>"$GITHUB_ENV"
- name: Compute terraform plugin cache key
if: inputs.s3-bucket-name != ''
id: tf_plugin_cache_key
run: |
echo "key=terraform-${{ runner.os }}-${{ steps.check_terraform_lockfiles.outputs.files_exists == 'true' && hashFiles('**/.terraform.lock.hcl') || hashFiles('**/terraform.tf', '**/versions.tf') }}" >> $GITHUB_OUTPUT
echo "key=terraform-${{ runner.os }}-${{ hashFiles('**/.terraform.lock.hcl', '**/terraform.tf', '**/versions.tf') }}" >> $GITHUB_OUTPUT
shell: bash
- name: Load cached terraform plugins if available
if: inputs.s3-bucket-name != ''
Expand Down

0 comments on commit 97b6924

Please sign in to comment.