Skip to content

Support passing GitHub Access tokens for github.com and GitHub Enterprise Server #865

@suzuki-shunsuke

Description

@suzuki-shunsuke

https://twitter.com/ponkio_o/status/1767126159043838218

Issue to solve

The input github_token is passed to tflint, github-comment, and reviewdog.
If you use a GitHub Enterprise Server, you have to use a GitHub Access Token of GitHub Enterprise Server for github-comment and reviewdog.
But in that case tflint --init fails to download plugins from github.com because the access token is for not github.com but GitHub Enterprise Server.

How to solve

To solve the issue, we'll add a new input like github_token_for_tflint_init.

e.g.

- uses: suzuki-shunsuke/github-action-tflint@main
  with:
    github_token: ${{ github.token }} # GitHub Token for github-comment and reviewdog
    github_token_for_tflint_init: ${{ secrets.GITHUB_TOKEN_FOR_TFLINT_INIT }} # GitHub Token for tflint --init
    github_comment: true

If github_token_for_tflint_init is set, the token is passed to tflint --init.
Otherwise, github_token is passed to tflint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions