terraform-linters / setup-tflint

A GitHub action that installs Terraform linter TFLint
MIT License
142 stars 38 forks source link

Github Token for tflint init #143

Closed entscheidungsproblem closed 1 year ago

entscheidungsproblem commented 1 year ago

I think the GitHub token is also needed for the tflint init step as I hit the rate limit in that step but had added the token to the setup step.

Run tflint --init
  tflint --init
  shell: /usr/bin/bash -e {0}
  env:
    TERRAFORM_CLI_PATH: ...
    MSYS: ...
    Installing `aws` plugin...
Failed to install a plugin; Failed to fetch GitHub releases: GET https://api.github.com/repos/terraform-linters/tflint-ruleset-aws/releases/tags/v0.21.1: 403 API rate limit exceeded for <IP>. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.) [rate reset in 20m25s]
Error: Process completed with exit code 1.

I think this section of the documentation should be updated

https://github.com/terraform-linters/setup-tflint/blob/8e58dbf076db925c8cd0bc742fa5cf56f3e9081a/README.md?plain=1#L80-L86

to look like this:

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

  - name: Init TFLint
    run: tflint --init
    env:
      GITHUB_TOKEN: ${{ secrets.MY_CUSTOM_GITHUB_TOKEN }}
trallnag commented 1 year ago

Why are you using a custom GitHub token?