Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENG-966] Make base dir an input variable #13

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions actions/terraform-checks/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
---
name: "Terraform Checks"
description: "Perform common Terraform checks"
inputs:
terraform_base_dir:
description: Which base dir to search for the Terraform config(s) in
required: false
default: infrastructure
runs:
using: "composite"
steps:
Expand Down Expand Up @@ -40,7 +45,7 @@ runs:

- name: "Run TFLint"
shell: bash
run: tflint --chdir infrastructure/ --recursive
run: tflint --chdir ${{ inputs.terraform_base_dir }}/ --recursive

- name: "Ascertain Terraform Version"
shell: bash
Expand All @@ -49,13 +54,13 @@ runs:
- name: "Checking Terraform Format of Files"
shell: bash
run: |
cd infrastructure
cd ${{ inputs.terraform_base_dir }}
terraform fmt -check $(find . -name '*tf')

- name: "Validate Terraform Configs"
shell: bash
run: |
cd infrastructure
cd ${{ inputs.terraform_base_dir }}
for d in $(find . -type d -mindepth 1 -maxdepth 1)
do
echo "Validating the $d config"
Expand Down