File tree Expand file tree Collapse file tree 3 files changed +28
-4
lines changed
Expand file tree Collapse file tree 3 files changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,12 @@ inputs:
2323 description : ' The directory upon which to lint Terraform configurations.'
2424 type : ' string'
2525 required : true
26+ default : ' .'
27+ terraform_linter_version :
28+ description : ' The version of the terraform linter to install and use.'
29+ type : ' string'
30+ required : true
31+ default : ' 0.2.0'
2632
2733runs :
2834 using : ' composite'
3945 run : |-
4046 terraform fmt -recursive -check -diff
4147
42- - name : ' abcxyz Terraform linter'
43- if : ' always()'
44- uses : ' abcxyz/terraform-linter@main' # ratchet:exclude
48+ - name : ' Setup terraform-linter'
49+ uses : ' abcxyz/actions/.github/actions/setup-binary@main' # ratchet:exclude
4550 with :
46- paths : ' ${{ inputs.directory }}'
51+ download_url : ' https://github.com/abcxyz/terraform-linter/releases/download/v${{ inputs.terraform_linter_version }}/terraform-linter_linux_amd64'
52+ install_path : ' ${{ runner.temp }}/.terraform-linter'
53+ binary_subpath : ' terraform-linter_linux_amd64'
54+ cache_key : ' ${{ runner.os }}_${{ runner.arch }}_terraform_linter_${{ inputs.terraform_linter_version }}'
55+ add_to_path : true
56+ destination_subpath : ' terraform-linter'
57+
58+ - name : ' Run abcxyz/terraform-linter'
59+ shell : ' bash'
60+ env :
61+ LINT_PATHS : |-
62+ ${{ inputs.directory || '.' }}
63+ run : |-
64+ terraform-linter lint ${LINT_PATHS}
Original file line number Diff line number Diff line change @@ -151,6 +151,8 @@ jobs:
151151 # #############
152152 TERRAFORM_LINT_TERRAFORM_VERSION : |-
153153 ${{ vars.TERRAFORM_LINT_TERRAFORM_VERSION }}
154+ TERRAFORM_LINT_TERRAFORM_LINTER_VERSION : |-
155+ ${{ vars.TERRAFORM_LINT_TERRAFORM_LINTER_VERSION || '0.2.0' }}
154156 TERRAFORM_LINT_DIRECTORY : |-
155157 ${{ vars.TERRAFORM_LINT_DIRECTORY || '' }}
156158 # #############
@@ -216,6 +218,7 @@ jobs:
216218 uses : ' ./.github/actions/lint-terraform' # ratchet:exclude
217219 with :
218220 terraform_version : ' ${{ env.TERRAFORM_LINT_TERRAFORM_VERSION }}'
221+ terraform_linter_version : ' ${{ env.TERRAFORM_LINT_TERRAFORM_LINTER_VERSION }}'
219222 directory : ' ${{ env.TERRAFORM_LINT_DIRECTORY }}'
220223
221224 - name : ' [YAML] lint yaml'
Original file line number Diff line number Diff line change @@ -152,6 +152,8 @@ jobs:
152152 # #############
153153 TERRAFORM_LINT_TERRAFORM_VERSION : |-
154154 ${{ vars.TERRAFORM_LINT_TERRAFORM_VERSION }}
155+ TERRAFORM_LINT_TERRAFORM_LINTER_VERSION : |-
156+ ${{ vars.TERRAFORM_LINT_TERRAFORM_LINTER_VERSION || '0.2.0' }}
155157 TERRAFORM_LINT_DIRECTORY : |-
156158 ${{ vars.TERRAFORM_LINT_DIRECTORY || '' }}
157159 # #############
@@ -223,6 +225,7 @@ jobs:
223225 uses : ' abcxyz/actions/.github/actions/lint-terraform@main' # ratchet:exclude
224226 with :
225227 terraform_version : ' ${{ env.TERRAFORM_LINT_TERRAFORM_VERSION }}'
228+ terraform_linter_version : ' ${{ env.TERRAFORM_LINT_TERRAFORM_LINTER_VERSION }}'
226229 directory : ' ${{ env.TERRAFORM_LINT_DIRECTORY }}'
227230
228231 - name : ' [YAML] lint yaml'
You can’t perform that action at this time.
0 commit comments