reviewdog / action-rubocop

Run rubocop with reviewdog 🐶
MIT License
114 stars 75 forks source link

action-rubocop stopped working because it can no longer install gems #39

Closed jordemort closed 3 years ago

jordemort commented 3 years ago

I suspect that GitHub changed something on their end - now action-rubocop always fails for me because it can't install the rubocop gem:

Run reviewdog/action-rubocop@v1
  with:
    rubocop_flags: --fail-level=warning
    rubocop_version: 1.8.1
    rubocop_extensions: rubocop-performance:1.9.2
    github_token: ***
    reporter: github-pr-review
    fail_on_error: true
    tool_name: rubocop
    level: error
    filter_mode: added
    workdir: .
🐶 Installing reviewdog ... https://github.com/reviewdog/reviewdog
  reviewdog/reviewdog info checking GitHub for tag 'v0.11.0'
  reviewdog/reviewdog info found version: 0.11.0 for v0.11.0/Linux/x86_64
  reviewdog/reviewdog info installed /tmp/tmp.rMlSghgehc/reviewdog
 Installing rubocop with extensions ... https://github.com/rubocop/rubocop
  ERROR:  While executing gem ... (Gem::FilePermissionError)
      You don't have write permissions for the /var/lib/gems/2.7.0 directory.
  Error: Process completed with exit code 1.

I am invoking it like this:

  rubocop:
    name: rubocop
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: false

      - name: rubocop
        if: always()
        uses: reviewdog/action-rubocop@v1
        with:
          rubocop_flags: --fail-level=warning
          rubocop_version: "1.8.1"
          rubocop_extensions: rubocop-performance:1.9.2
          github_token: ${{ secrets.BOT_GH_TOKEN }}
          reporter: github-pr-review
          fail_on_error: true
ohbarye commented 3 years ago

@jordemort It seems the same as https://github.com/reviewdog/action-rubocop/issues/34.

How about trying to add ruby/setup-ruby action into your workflow file as described in https://github.com/reviewdog/action-rubocop/issues/34#issuecomment-789533911 ?

jordemort commented 3 years ago

@ohbarye Yes, that worked. Thank you!