From a67e0115213285ee18c6fb73964a2f555340eb30 Mon Sep 17 00:00:00 2001 From: Anmol Nagpal <4303310+anmolnagpal@users.noreply.github.com> Date: Tue, 8 Aug 2023 17:15:06 +0530 Subject: [PATCH 1/3] Update .tflint.hcl (#59) --- .github/config/.tflint.hcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/config/.tflint.hcl b/.github/config/.tflint.hcl index 2f507004..71131a15 100644 --- a/.github/config/.tflint.hcl +++ b/.github/config/.tflint.hcl @@ -6,9 +6,9 @@ config { plugin "aws" { enabled = true - version = "0.21.0" + version = "0.25.0" source = "github.com/terraform-linters/tflint-ruleset-aws" - deep_check = false + deep_check = true } rule "aws_instance_invalid_type" { From 78739159599620dd0f5d1e3b848e60fde1cf9596 Mon Sep 17 00:00:00 2001 From: Tanveer143s <116706588+Tanveer143s@users.noreply.github.com> Date: Thu, 10 Aug 2023 16:39:42 +0530 Subject: [PATCH 2/3] feat: Updated tflint.hcl and tflint.yml files (#61) --- .github/config/.tflint.hcl | 17 ++++---- .github/workflows/tf-lint.yml | 73 ++++++++++++++++------------------- 2 files changed, 43 insertions(+), 47 deletions(-) diff --git a/.github/config/.tflint.hcl b/.github/config/.tflint.hcl index 71131a15..d17f0e80 100644 --- a/.github/config/.tflint.hcl +++ b/.github/config/.tflint.hcl @@ -1,24 +1,25 @@ // https://github.com/terraform-linters/tflint/blob/master/docs/guides/config.md config { module = false - force = false + force = false } plugin "aws" { - enabled = true - version = "0.25.0" - source = "github.com/terraform-linters/tflint-ruleset-aws" - deep_check = true + enabled = true + version = "0.21.0" + source = "github.com/terraform-linters/tflint-ruleset-aws" + deep_check = false } rule "aws_instance_invalid_type" { - enabled = false + enabled = true } rule "aws_instance_previous_type" { - enabled = false + enabled = true } rule "terraform_required_providers" { - enabled = false + enabled = true } + diff --git a/.github/workflows/tf-lint.yml b/.github/workflows/tf-lint.yml index 7b470894..4b14127b 100644 --- a/.github/workflows/tf-lint.yml +++ b/.github/workflows/tf-lint.yml @@ -2,7 +2,6 @@ name: tf-lint on: workflow_call: - # Secrets can be defined to use during workflow call. secrets: GITHUB: required: true @@ -12,42 +11,38 @@ jobs: tflint: runs-on: ubuntu-latest - # Checkout the repository to the GitHub Actions runner steps: - - uses: actions/checkout@v3 - name: Checkout source code - - # Action to add tflint plugin based in OS - - uses: actions/cache@v3 - name: Cache plugin dir - with: - path: ~/.tflint.d/plugins - key: ubuntu-latest-tflint-${{ hashFiles('.tflint.hcl') }} - - #Setting up terraform lint - - uses: terraform-linters/setup-tflint@v3 - name: Setup TFLint - with: - tflint_version: v0.44.1 - github_token: ${{ secrets.GITHUB }} - - # Added tflint config to check tflint additional rules - - uses: terraform-linters/tflint-load-config-action@v1 - name: Setup tflint-config - with: - source-repo: clouddrove/github-shared-workflows - source-path: .github/config/.tflint.hcl - - # Verfiy the installed tflint version. - - name: Show version - run: tflint --version - - - name: init lint - run: tflint --init - env: - # https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md#avoiding-rate-limiting - GITHUB_TOKEN: ${{ github.token }} - - # command to check tf lint in terraform code. - - name: Run lint - run: tflint --recursive --color --force -f compact \ No newline at end of file + - uses: actions/checkout@v3 + name: Checkout source code + + - uses: actions/cache@v3 + name: Cache plugin dir + with: + path: ~/.tflint.d/plugins + key: ubuntu-latest-tflint-${{ hashFiles('.tflint.hcl') }} + + - uses: terraform-linters/setup-tflint@v3 + name: Setup TFLint + with: + tflint_version: v0.44.1 + github_token: ${{ secrets.GITHUB }} + + - uses: terraform-linters/tflint-load-config-action@v1 + name: Setup tflint-config + with: + source-repo: clouddrove/github-shared-workflows + source-path: .github/config/.tflint.hcl + source-ref: master + + - name: Show version + run: tflint --version + + - name: init lint + run: tflint --init + env: + GITHUB_TOKEN: ${{ github.token }} + + - name: Run lint + run: tflint --recursive --color --force -f compact + env: + GITHUB_TOKEN: ${{ github.token }} From 999cfb01d1bf7b8cfad71afeff213dba98312c65 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Aug 2023 03:15:56 +0200 Subject: [PATCH 3/3] build(deps): bump google-github-actions/auth from 0 to 1 (#62) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/terraform_workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform_workflow.yml b/.github/workflows/terraform_workflow.yml index b230941b..4fc3b537 100644 --- a/.github/workflows/terraform_workflow.yml +++ b/.github/workflows/terraform_workflow.yml @@ -108,7 +108,7 @@ jobs: - name: Install GCP CLI if: ${{ inputs.provider == 'gcp' }} - uses: google-github-actions/auth@v0 + uses: google-github-actions/auth@v1 with: service_account_key: ${{ secrets.GCP_SA_KEY }} project_id: ${{ secrets.PROJECT_ID }}