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

GitHub Action does not work while running reviewdog with rdjson and github-pr-review reporter #1403

Open
marcinguy opened this issue Mar 9, 2023 · 1 comment

Comments

@marcinguy
Copy link

marcinguy commented Mar 9, 2023

Hi!

Have this GitHub Action:

env:
  LIC: ${{secrets.LIC}}
  SNYK_TOKEN: ${{secrets.SNYK_TOKEN}}
  REVIEWDOG_GITHUB_API_TOKEN: ${{secrets.REVIEWDOG_GITHUB_API_TOKEN}}

name: Review
on: 
 pull_request:
   types: [opened, edited, reopened, review_requested, synchronize]
   branches:
      - 'master'
jobs:
  Betterscan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: Betterscan Scan
        uses: topcodersonline/betterscancustom@v1
        with:
         branch: ${{ github.head_ref || github.ref_name }}   
      - uses: "finnp/create-file-action@master"
        env:
          FILE_NAME: "to-rdjson.jq"
          FILE_BASE64: "ewogIHNvdXJjZTogewogICAgbmFtZTogImJldHRlcnNjYW4iLAogICAgdXJsOiAiaHR0cHM6Ly9naXRodWIuY29tL21hcmNpbmd1eS9iZXR0ZXJzY2FuLWNlIgogIH0sCiAgZGlhZ25vc3RpY3M6IC4gfCBtYXAoewogICAgbWVzc2FnZTogLmRlc2NyaXB0aW9uLAogICAgY29kZTogewogICAgICB2YWx1ZTogLmhhc2gsCiAgICAgIHVybDogImh0dHBzOi8vZ2l0aHViLmNvbS9tYXJjaW5ndXkvYmV0dGVyc2Nhbi1jZSIsCiAgICB9ICwKICAgIGxvY2F0aW9uOiB7CiAgICAgIHBhdGg6IC5maWxlLAogICAgICByYW5nZTogewogICAgICAgIHN0YXJ0OiB7CiAgICAgICAgICBsaW5lOiAubGluZSwKICAgICAgICAgIGNvbHVtbjogMQogICAgICAgIH0KICAgICAgfQogICAgfSwKICAgIHNldmVyaXR5OiAoKC5zZXZlcml0eXxhc2NpaV91cGNhc2V8c2VsZWN0KG1hdGNoKCJFUlJPUnxXQVJOSU5HfElORk8iKSkpLy9udWxsKQogIH0pCn0="
      - uses: reviewdog/action-setup@v1
        with:
          reviewdog_version: latest # Optional. [latest,nightly,v.X.Y.Z]
      - name: Run reviewdog
        run: |
          cat report.json| jq -f to-rdjson.jq | reviewdog -f=rdjson -reporter=github-pr-review

It does not seem to work.

I see this:

image

and no review comments here:

image

It works with github-check reporter ok.

Env vars are set.

Any ideas?

BTW is the project still maintained and developed? cc @haya14busa

Thanks,

@marcinguy
Copy link
Author

Got it to work with this:

env:
  LIC: ${{secrets.LIC}}
  SNYK_TOKEN: ${{secrets.SNYK_TOKEN}}
  REVIEWDOG_GITHUB_API_TOKEN: ${{secrets.REVIEWDOG_GITHUB_API_TOKEN}}

name: Review
on: 
 pull_request:
   types: [opened, edited, reopened, review_requested, synchronize]
   branches:
      - 'main'
jobs:
  Betterscan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: Betterscan Scan
        uses: topcodersonline/betterscancustom@v1
        with:
         branch: ${{ github.head_ref || github.ref_name }}   
      - uses: "finnp/create-file-action@master"
        env:
          FILE_NAME: "to-rdjson.jq"
          FILE_BASE64: "ewogIHNvdXJjZTogewogICAgbmFtZTogImJldHRlcnNjYW4iLAogICAgdXJsOiAiaHR0cHM6Ly9naXRodWIuY29tL21hcmNpbmd1eS9iZXR0ZXJzY2FuLWNlIgogIH0sCiAgZGlhZ25vc3RpY3M6IC4gfCBtYXAoewogICAgbWVzc2FnZTogLmRlc2NyaXB0aW9uLAogICAgY29kZTogewogICAgICB2YWx1ZTogLmhhc2gsCiAgICAgIHVybDogImh0dHBzOi8vZ2l0aHViLmNvbS9tYXJjaW5ndXkvYmV0dGVyc2Nhbi1jZSIsCiAgICB9ICwKICAgIGxvY2F0aW9uOiB7CiAgICAgIHBhdGg6IC5maWxlLAogICAgICByYW5nZTogewogICAgICAgIHN0YXJ0OiB7CiAgICAgICAgICBsaW5lOiAubGluZSwKICAgICAgICAgIGNvbHVtbjogMQogICAgICAgIH0KICAgICAgfQogICAgfSwKICAgIHNldmVyaXR5OiAoKC5zZXZlcml0eXxhc2NpaV91cGNhc2V8c2VsZWN0KG1hdGNoKCJFUlJPUnxXQVJOSU5HfElORk8iKSkpLy9udWxsKQogIH0pCn0="
      - uses: reviewdog/action-setup@v1
        with:
          reviewdog_version: latest # Optional. [latest,nightly,v.X.Y.Z]
      - name: Run reviewdog
        run: |
          cat report.json| jq -f to-rdjson.jq | reviewdog -f=rdjson -reporter=github-pr-review -filter-mode=nofilter -level=error -tee

It shows now:

image

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