Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include link in github-pr-review output #90

Open
jrobison-sb opened this issue Aug 8, 2024 · 1 comment
Open

Include link in github-pr-review output #90

jrobison-sb opened this issue Aug 8, 2024 · 1 comment

Comments

@jrobison-sb
Copy link

When I run tflint --chdir=path/to/my/module/ --format=checkstyle using vanilla tflint (outside the context of this GitHub Action, and outside the context of ReviewDog), I can get output like this which includes a link to the tflint docs so I can fix whatever it complains about:

    <error source="terraform_unused_declarations" line="844" column="1" severity="warning" message="variable &#34;unused_variable&#34; is declared but not used" link="https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.8.0/docs/rules/terraform_unused_declarations.md" rule="terraform_unused_declarations"></error>

But when I see the same error using this GitHub Action and using reporter: github-pr-review, it includes no such link.

image

It would be nicer if the link was included in the PR comment so the person could be pointed towards whatever they need to do to fix their mistake.

@jrobison-sb
Copy link
Author

Here is my full action, in case that is helpful:

name: tflint
on:
  pull_request:
    paths:
      - 'path/to/my/module/*.tf'

jobs:
  tflint:
    name: tflint
    runs-on: ubuntu-latest

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

      - name: tflint
        uses: reviewdog/action-tflint@v1
        with: # https://github.com/reviewdog/action-tflint#inputs
          github_token: ${{ secrets.GITHUB_TOKEN }}
          working_directory: "path/to/my/module" # Optional. Change working directory
          reporter: github-pr-review # Post the output as PR comments
          fail_on_error: "true" # Optional. Fail action if errors are found
          filter_mode: "added" # Optional. Only complain about the diffs in the PR. https://github.com/reviewdog/reviewdog/tree/master?tab=readme-ov-file#filter-mode
          tflint_init: "true" # Optional. Run `tflint --init` before running code analysis
          flags: "" # Optional. Add custom tflint flags

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant