Coder Social home page Coder Social logo

devops-infra / action-tflint Goto Github PK

View Code? Open in Web Editor NEW
16.0 3.0 3.0 145 KB

GitHub Action that will run TFlint on Terraform files.

Home Page: https://christophshyper.github.io/

License: MIT License

Dockerfile 50.46% Makefile 32.72% Shell 16.82%
tflint linter terraform terraform-scripts terraform-modules christophshyper github-action github-actions github-action-docker github-actions-docker docker dockerhub automation cicd ci-cd devops devops-workflow iaac action-tflint

action-tflint's Introduction

GitHub Action linting Terraform files

GitHub Action that will run TFlint on Terraform files.

Dockerized as devopsinfra/action-tflint.

Uses the newest version of Terraform and TFLint for the current release.

So it's main use will be everywhere where Terraform is used and is great for statically or actively checking modules' sources.

Main action is using wata727's TFLint.

Badge swag

Master branch Other branches
GitHub repo GitHub code size in bytes GitHub last commit GitHub license
DockerHub Docker version Image size Docker Pulls

Reference

    - name: Run the Action
      uses: devops-infra/[email protected]
      with:
        dir_filter: modules
Input Variable Required Default Description
dir_filter No * Prefixes or sub-directories to search for Terraform modules. Use comma as separator.
fail_on_changes No true Whether TFLint should fail whole action.
tflint_config No .tflint.hcl Location from repository root to TFLint config file. Disables tflint_params.
tflint_params No `` Parameters passed to TFLint binary. See TFLint for details.
run_init No true Whether the action should run terraform init. Defaults to true.

Examples

By default fail if lint errors found in any subdirectory. Run the Action via GitHub.

name: Check TFLint
on:
  push:
    branches:
      - "**"
jobs:
  format-hcl:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v2
    - name: Check linting of Terraform files
      uses: devops-infra/[email protected]

Use different location for TFLint config file and parse only aws* and gcp* modules in modules/ directory. Run the Action via GitHub.

name: Check TFLint with custom config
on:
  push:
    branches:
      - "**"
jobs:
  format-hcl:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v2
    - name: Check linting of Terraform modules
      uses: devops-infra/[email protected]
      with:
        tflint_config: modules/.tflint.hcl
        dir_filter: modules/aws,modules/gcp

Use deep check (need cloud credentials) and treat all directories under modules as Terraform modules. Run the Action via DockerHub.

name: Check TFLint with custom config
on:
  push:
    branches:
      - "**"
jobs:
  format-hcl:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v2
    - name: Check linting of Terraform modules
      uses: devops-infra/[email protected]
      with:
        tflint_params: "--module --deep"
        dir_filter: modules

action-tflint's People

Contributors

christophshyper avatar dependabot[bot] avatar pawelaugustyn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

action-tflint's Issues

Enabling debug logs

One can use TFLINT_LOG=debug tflint to see detailed logs. How can we enable it for this GitHub action?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.