You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Setup TFLint
v2.0.1
A GitHub action that installs a Terraform linter TFLint executable in the PATH.
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"
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.
The action does not have any output.
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@v2
name: Checkout source code
- uses: actions/cache@v2
name: Cache plugin dir
with:
path: ~/.tflint.d/plugins
key: ${{ matrix.os }}-tflint-${{ hashFiles('.tflint.hcl') }}
- uses: terraform-linters/setup-tflint@v2
name: Setup TFLint
with:
tflint_version: v0.38.1
- name: Show version
run: tflint --version
- name: Init TFLint
run: tflint --init
- name: Run TFLint
run: tflint -f compact
- uses: terraform-linters/setup-tflint@v2
or specify it explicitly as
- uses: terraform-linters/setup-tflint@v2
with:
tflint_version: latest
- uses: terraform-linters/setup-tflint@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- uses: terraform-linters/setup-tflint@v2
- uses: terraform-linters/tflint-load-config-action@v0
with:
source-repo: me/tflint-config
- run: tflint -f compact
This action supports Problem Matchers for --format compact
. You can see annotations in pull requests when TFLint prints issues with the compact
format.
To create a new version:
npm version $inc && git push --follow-tags