No description
  • JavaScript 93.5%
  • Shell 4.8%
  • HCL 1.7%
Find a file
2021-07-22 13:56:19 -07:00
.github Verify generated files in CI instead of auto-commit (#14) 2021-04-18 02:25:32 +09:00
.husky Release v1.0.0 2021-01-19 18:35:37 -06:00
dist Verify generated files in CI instead of auto-commit (#14) 2021-04-18 02:25:32 +09:00
src Add Problem Matcher (#13) 2021-04-10 18:50:54 +09:00
test Add entrypoint 2021-01-19 19:07:34 -06:00
.editorconfig Release v1.0.0 2021-01-19 18:35:37 -06:00
.eslintignore Initial commit of TFLint action 2020-07-22 18:24:42 +02:00
.eslintrc.js Release v1.0.0 2021-01-19 18:35:37 -06:00
.gitignore Add dist/index.js (#6) 2021-03-01 13:33:20 -08:00
.prettierrc.js Release v1.0.0 2021-01-19 18:35:37 -06:00
action.yml Release v1.0.0 2021-01-19 18:35:37 -06:00
annotations.png Add Problem Matcher (#13) 2021-04-10 18:50:54 +09:00
example.tf Add Problem Matcher (#13) 2021-04-10 18:50:54 +09:00
index.js Add entrypoint 2021-01-19 19:07:34 -06:00
LICENSE Initial commit of TFLint action 2020-07-22 18:24:42 +02:00
package-lock.json 1.1.0 2021-04-18 02:28:30 +09:00
package.json 1.1.0 2021-04-18 02:28:30 +09:00
README.md docs: reference tflint-load-config-action 2021-07-22 13:56:19 -07:00

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@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@v1
      name: Setup TFLint
      with:
        tflint_version: v0.29.0

    - name: Show version
      run: tflint --version

    - name: Init TFLint
      run: tflint --init

    - name: Run TFLint
      run: tflint -f compact

Latest Release

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

or specify it explicitly as

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

Using GITHUB_TOKEN

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

Loading Shared Configuration

- uses: terraform-linters/setup-tflint@v1
- uses: terraform-linters/tflint-load-config-action@v0
  with:
    source-repo: me/tflint-config
- run: tflint -f compact

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