reviewdog / action-suggester

:dog: Suggests any code changes based on diff through GitHub Multi-line code suggestions by using reviewdog
MIT License
105 stars 11 forks source link

Can't really make it work with ESLint #17

Open valerioleo opened 3 years ago

valerioleo commented 3 years ago

First of all, thanks for the massive efforts around reviewdog. It's in plain sight the amount of work you poured in for everybody to enjoy.

I have been trying to set reviewdog in my CI on Github Actions and I only managed to get reports in the PR like this:

image

But never to get code comments/suggestions.

This is my current action file:

name: reviewdog
on: [pull_request]
jobs:
  eslint:
    runs-on: ubuntu-latest

    name: runner / eslint

    steps:
      - uses: actions/checkout@v2
        with:
          submodules: recursive
          token: ${{ secrets.CI_ACCESS_TOKEN }}

      - uses: reviewdog/action-setup@v1
        with:
          reviewdog_version: latest

      - uses: reviewdog/action-eslint@v1
        env:
          REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          reporter: github-pr-review
          level: error
          filter_mode: added

      - uses: reviewdog/action-suggester@v1
        with:
          tool_name: eslint

Is there anything I'm missing?

In my understanding the reviewdog/action-eslint@v1 action will output the result and the reviewdog/action-suggester@v1 will print it as comments/suggestions. But really can't manage to make this work 🤷🏻‍♂️

Thank you so much for any help.

airtonix commented 2 years ago

It's pretty unclear how we're to use reviewdog effectively.

from my mere mortal peasant point of view, it looks like :

 - run: `eslint --fix` 
 - uses: reviewdog/action-suggester@v1
        with:
          tool_name: eslint

I say this because it says in the README.md :

...which suggests any code changes based on diff ...

shogo82148 commented 1 year ago
image

The image look like Annotation, not a review comment.

reviewdog uses Annotation if the GitHub token has no permission for writing you pull request. (e.g. pull request from forked repository) https://github.com/reviewdog/reviewdog/blob/f297ab3e3857d7b5639b65824b9c6d646b3c120a/cienv/github_actions.go#L110-L120

ref. https://github.com/reviewdog/reviewdog/issues/1210