reviewdog / action-tflint

Run tflint with reviewdog on pull requests to enforce best practices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Terraform module is not recognized

yukin01 opened this issue · comments

I ran terraform init in GitHub Actions step, but the module is not recognized. This is probably because the directory to run tflint is not working_directory.

Error: `parameter_store` module is not found. Did you run `terraform init`?

  on dev/parameter_store.tf line 1, in module "parameter_store":
   1: module "parameter_store" {
  • workflow/tflint.yaml
jobs:
  lint:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        workdir: ["dev"]
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Init
        uses: hashicorp/terraform-github-actions@master
        with:
          tf_actions_version: 0.12.24
          tf_actions_subcommand: init
          tf_actions_working_dir: ${{ matrix.workdir }}
          tf_actions_cli_credentials_token: ${{ secrets.TFC_TOKEN }}
      - name: Lint
        uses: reviewdog/action-tflint@v1
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          working_directory: ${{ matrix.workdir }}
          flags: >-
            --module
            --enable-rule=terraform_dash_in_output_name
            --enable-rule=terraform_dash_in_resource_name
            --enable-rule=terraform_dash_in_data_source_name
            --enable-rule=terraform_dash_in_module_name