Skip to content

A GitHub action that installs Terraform linter TFLint

License

Notifications You must be signed in to change notification settings

syllogy/setup-tflint

 
 

Repository files navigation

Setup TFLint Action

A GitHub action that installs a Terraform linter TFLint executable in the PATH.

Inputs

tflint_version

Required The version of TFLint which will be installed. See TFLint releases page for valid versions.

If version is "latest", the action will get the latest version number using Octokit.

Default: "latest"

github_token

If set, github_token will be used for Octokit authentication. Authenticating will increase the API rate limit when querying the tflint repository to get the latest release version.

Outputs

The action does not have any output.

Usage

name: Lint
on:
  push:
    branches: [ master ]
  pull_request:

jobs:
  tflint:
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]

    steps:
    - uses: actions/checkout@v1
      name: Checkout source code

    - uses: terraform-linters/setup-tflint@v1
      name: Setup TFLint
      with:
        tflint_version: v0.26.0

    - name: Show version
      run: tflint --version

    - name: Run TFLint
      run: tflint -f compact

For latest release you can omit version variable and use

- uses: terraform-linters/setup-tflint@v1

or specify it explicitly as

- uses: terraform-linters/setup-tflint@v1
  with:
    tflint_version: latest

For authenticating with the GITHUB_TOKEN you can use

- uses: terraform-linters/setup-tflint@v1
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}

Checks

This action supports Problem Matchers for --format compact. You can see annotations in pull requests when TFLint prints issues with the compact format.

annotations

Releasing

To create a new version:

npm version $inc && git push --follow-tags

About

A GitHub action that installs Terraform linter TFLint

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 97.4%
  • Shell 1.9%
  • HCL 0.7%