An open API service indexing awesome lists of open source software.

https://github.com/suzuki-shunsuke/github-action-tflint

GitHub Actions for tflint
https://github.com/suzuki-shunsuke/github-action-tflint

Last synced: about 1 month ago
JSON representation

GitHub Actions for tflint

Awesome Lists containing this project

README

        

# github-action-tflint

GitHub Actions for [tflint](https://github.com/terraform-linters/tflint).

image

image

Run tflint and notify the result with [reviewdog](https://github.com/reviewdog/reviewdog) and [github-comment](https://github.com/suzuki-shunsuke/github-comment).
This GitHub Actions does **not** install tflint and reviewdog, so you have to install them in advance.
It allows to install tools outside this action.
We recommend [aqua](https://aquaproj.github.io/) to install them.

## Motivation

We know there are other GitHub Actions for tflint.
They install tflint automatically, but we would like to manage tools with [aqua](https://aquaproj.github.io/), which is a declarative CLI Version Manager written in Go.
By aqua, you can update tools continuously with Renovate very easily and use the same tool versions in both CI and your development environment.
This GitHub Actions does **not** install tflint, so we can install them outside this action.

## Requirements

* [tflint](https://github.com/terraform-linters/tflint) >= [v0.50.0](https://github.com/terraform-linters/tflint/releases/tag/v0.50.0)
* [reviewdog](https://github.com/reviewdog/reviewdog)
* (Optional) [github-comment](https://github.com/suzuki-shunsuke/github-comment)

## Notification with reviewdog

image

## Notification with github-comment

image

```yaml
- uses: suzuki-shunsuke/github-action-tflint@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
working_directory: tests
github_comment: true # Enable github-comment notification
```

:bulb: If you want to hide old notification, please use [github-comment hide command](https://github.com/suzuki-shunsuke/github-comment#hide).

## Example

```yaml
- uses: suzuki-shunsuke/[email protected]
```

```yaml
- uses: suzuki-shunsuke/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token_for_tflint_init: ${{ secrets.GH_TOKEN_FOR_TFLINT_INIT }}
working_directory: foo
github_comment: true
```

## Inputs

### Required Inputs

Nothing.

### Optional Inputs

name | default value | description
--- | --- | ---
github_token | `github.token` | GitHub Access Token
github_token_for_tflint_init | `github_token` | GitHub Access Token for `tflint --init`. It this isn't set, the input `github_token` is used. This input is useful for a GitHub Enterprise Server
working_directory | "" (current directory) | Woring Directory
github_comment | `false` | Whether a comment is posted with github-comment

## Outputs

Nothing.

## License

[MIT](LICENSE)