rickardl / tflint-action

This action runs https://github.com/terraform-linters/tflint

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Terraform TFLint action

This action runs https://github.com/terraform-linters/tflint on $GITHUB_WORKSPACE. TFLint is a Terraform linter focused on possible errors, best practices, etc. (Terraform >= 0.12)

The action requires the actions/checkout@v2 before to download the content of your repo inside the docker.

Inputs

Parameter Value Description
TFLINT_ACTION_COMMENT true (Optional) Whether or not to comment on GitHub pull requests.
TFLINT_ACTION_TERRAFORM_FOLDER . Which directory the Terraform code resides. Relative to the root of the repository.
TFLINT_ACTION_OPTS none Optional arguments to tflint.

Usage

on: pull_request
name: tflint action
jobs:
  lint:
    name: Terraform Lint on PR
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: rickardl/tflint-action@v1

The above example uses a tagged version (v1), you can also opt to use any of the released version.

To allow the action to add a comment to a PR when it fails you need to append the GITHUB_TOKEN variable to the tflint action:

  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Full example:

jobs:
  tflint:
    name: tlint
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Terraform Lint
        uses: rickardl/tflint-action@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Authors

Currently maintained by these contributors.

License

MIT License. See LICENSE for full details.

About

This action runs https://github.com/terraform-linters/tflint

License:MIT License


Languages

Language:Shell 79.9%Language:Dockerfile 16.4%Language:HCL 3.7%