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

Tflint 1 #1

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
23 changes: 23 additions & 0 deletions .github/config/.tflint.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
config {
module = false
force = false
}

plugin "aws" {
enabled = true
version = "0.21.0"
source = "github.com/terraform-linters/tflint-ruleset-aws"
deep_check = false
}

rule "aws_instance_invalid_type" {
enabled = false
}

rule "aws_instance_previous_type" {
enabled = false
}

rule "terraform_required_providers" {
enabled = false
}
48 changes: 48 additions & 0 deletions .github/workflows/lintcaller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Tf lint work flow checks for possible errors, best practices in your terraform code.
name: tf-lint
on:
workflow_call:
secrets:
GITHUB:
required: true
description: 'PAT of the user to run the jobs.'

jobs:
tflint:
runs-on: ubuntu-latest

steps:
- 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: Tanveer143s/tflint-test
source-path: .github/config/.tflint.hcl
source-ref: tflint-1

- 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 }}
6 changes: 3 additions & 3 deletions .github/workflows/tflint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: tf-lint
name: tf-lint
on:
push:
branches: [ master ]
# push:
# branches: [ master ]
pull_request:
workflow_dispatch:
jobs:
Expand Down
Loading