All Projects → reviewdog → action-tflint

reviewdog / action-tflint

Licence: MIT License
Run tflint with reviewdog on pull requests to enforce best practices

Programming Languages

shell
77523 projects
HCL
1544 projects

Projects that are alternatives of or similar to action-tflint

action-ktlint
Run Ktlint with reviewdog
Stars: ✭ 41 (-36.92%)
Mutual labels:  reviewdog
action-rubocop
Run rubocop with reviewdog 🐶
Stars: ✭ 83 (+27.69%)
Mutual labels:  reviewdog
action-eslint
Run eslint with reviewdog
Stars: ✭ 173 (+166.15%)
Mutual labels:  reviewdog
serverless-rules
Compilation of rules to validate infrastructure-as-code templates against recommended practices for serverless applications.
Stars: ✭ 352 (+441.54%)
Mutual labels:  tflint
action-tfsec
Run tfsec with reviewdog on pull requests to enforce security best practices
Stars: ✭ 52 (-20%)
Mutual labels:  reviewdog
action-languagetool
Run languagetool with reviewdog 🐶
Stars: ✭ 24 (-63.08%)
Mutual labels:  reviewdog
tflint-ruleset-aws
TFLint ruleset for terraform-provider-aws
Stars: ✭ 182 (+180%)
Mutual labels:  tflint
action-dotenv-linter
GitHub Action to run dotenv-linter ⚡️
Stars: ✭ 14 (-78.46%)
Mutual labels:  reviewdog
action-brakeman
Run brakeman with reviewdog 🐶
Stars: ✭ 22 (-66.15%)
Mutual labels:  reviewdog
action-misspell
Run misspell with reviewdog
Stars: ✭ 67 (+3.08%)
Mutual labels:  reviewdog
Tflint
A Pluggable Terraform Linter
Stars: ✭ 2,756 (+4140%)
Mutual labels:  tflint
action-markdownlint
Run markdownlint with reviewdog
Stars: ✭ 11 (-83.08%)
Mutual labels:  reviewdog
action-textlint
Run textlint with reviewdog on pull requests to improve document writing experience.
Stars: ✭ 41 (-36.92%)
Mutual labels:  reviewdog
action-hadolint
Run hadolint with reviewdog 🐶
Stars: ✭ 38 (-41.54%)
Mutual labels:  reviewdog
action-shellcheck
Run shellcheck with reviewdog
Stars: ✭ 64 (-1.54%)
Mutual labels:  reviewdog

GitHub Action: Run tflint with reviewdog

Test reviewdog release GitHub release (latest SemVer) action-bumpr supported depup

This action runs tflint with reviewdog on pull requests to enforce best practices.

Examples

With github-pr-check

By default, with reporter: github-pr-check an annotation is added to the line:

Example comment made by the action, with github-pr-check

With github-pr-review

With reporter: github-pr-review a comment is added to the Pull Request Conversation:

Example comment made by the action, with github-pr-review

Inputs

github_token

Required. Must be in form of github_token: ${{ secrets.github_token }}.

level

Optional. Report level for reviewdog [info,warning,error]. It's same as -level flag of reviewdog. The default is error.

reporter

Optional. Reporter of reviewdog command [github-pr-check,github-pr-review]. The default is github-pr-check.

filter_mode

Optional. Filtering for the reviewdog command [added,diff_context,file,nofilter].

The default is added.

See reviewdog documentation for filter mode for details.

fail_on_error

Optional. Exit code for reviewdog when errors are found [true,false].

The default is false.

See reviewdog documentation for exit codes for details.

working_directory

Optional. Directory to run the action on, from the repo root. The default is . ( root of the repository).

tflint_version

Optional. The tflint version to install and use. The default is latest.

tflint_rulesets

Optional. Space separated, official (from the terraform-linters GitHub organization) tflint rulesets to install and use. If a pre-configured TFLINT_PLUGIN_DIR is set, rulesets are installed in that directory. Default is `` (empty).

tflint_init

Optional. Whether to run tflint --init prior to linting (useful if you have a .tflint.hcl with some values in it). The default is false.

flags

Optional. List of arguments to send to tflint. For the output to be parsable by reviewdog --format=checkstyle is enforced. The default is --module.

Outputs

tflint-return-code

The tflint command return code.

reviewdog-return-code

The reviewdog command return code.

Example usage

name: reviewdog
on: [pull_request]
jobs:
  tflint:
    name: runner / tflint
    runs-on: ubuntu-latest

    steps:
      - name: Clone repo
        uses: actions/checkout@master

      # Install latest Terraform manually as
      #  Docker-based GitHub Actions are
      #  slow due to lack of caching
      # Note: Terraform is not needed for tflint
      - name: Install Terraform
        run: |
          brew install terraform

      # Run init to get module code to be able to use `--module`
      - name: Terraform init
        run: |
          terraform init

      # Minimal example
      - name: tflint
        uses: reviewdog/action-tflint@master
        with:
          github_token: ${{ secrets.github_token }}

      # More complex example
      - name: tflint
        uses: reviewdog/action-tflint@master
        with:
          github_token: ${{ secrets.github_token }}
          working_directory: "testdata" # Optional. Change working directory
          reporter: github-pr-review # Optional. Change reporter
          fail_on_error: "true" # Optional. Fail action if errors are found
          filter_mode: "nofilter" # Optional. Check all files, not just the diff
          tflint_version: "v0.24.0" # Optional. Custom version, instead of latest
          tflint_rulesets: "azurerm google" # Optional. Extra official rulesets to install
          flags: "--module" # Optional. Add custom tflint flags

Development

Release

haya14busa/action-bumpr

You can bump version on merging Pull Requests with specific labels (bump:major,bump:minor,bump:patch). Pushing tag manually by yourself also work.

haya14busa/action-update-semver

This action updates major/minor release tags on a tag push. e.g. Update v1 and v1.2 tag when released v1.2.3. ref: https://help.github.com/en/articles/about-actions#versioning-your-action

Lint - reviewdog integration

This reviewdog action template itself is integrated with reviewdog to run lints which is useful for Docker container based actions.

Supported linters:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].