reviewdog / action-rubocop

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

Versions past 1.7.1 fail to install the rubocop gem #34

Closed dnorth98 closed 3 years ago

dnorth98 commented 3 years ago

It looks like since 1.7.1, the action has been broken. I'm guessing not many people may have noticed because this just caues the check to succeed :awk:

image

I took a look at the diff and I can't quite see why it would now be broken but certainly any version past 1.7.1 exhibits this error.

mgrachev commented 3 years ago

Hey @dnorth98 👋

Do you use the setup-ruby action in your workflow file?

Example:

name: reviewdog
on: [pull_request]
jobs:
  rubocop:
    name: runner / rubocop
    runs-on: ubuntu-latest
    steps:
      - name: Check out code
        uses: actions/checkout@v1
      - uses: ruby/setup-ruby@v1
        with:
          ruby-version: 3.0.0
      - name: rubocop
        uses: reviewdog/action-rubocop@v1
        with:
          rubocop_version: gemfile
          rubocop_extensions: rubocop-rails:gemfile rubocop-rspec:gemfile
          github_token: ${{ secrets.github_token }}
dnorth98 commented 3 years ago

@mgrachev Oh interesting! No, we don't. Guess this is a new requirement? I'll look at adding that and see if it addresses the problem.

dnorth98 commented 3 years ago

That did it. Thanks for the info! 👍

ohbarye commented 3 years ago

I got the same error and https://github.com/reviewdog/action-rubocop/issues/34#issuecomment-789533911 fixes it on my end. Thanks.

antondalgren commented 3 years ago

Just noticed this after #36 was merged. https://github.com/reviewdog/action-rubocop/issues/34#issuecomment-789533911 also fixes it on my end. How long has it been like this? 🤔

mgrachev commented 3 years ago

Just noticed this after #36 was merged. #34 (comment) also fixes it on my end. How long has it been like this? 🤔

I have updated the README.md file 17 days ago 😅 Ref: https://github.com/reviewdog/action-rubocop/commit/1027eecf519f69d84c4e33194dc8fae61c8cba65

dnorth98 commented 3 years ago

Just noticed this after #36 was merged. #34 (comment) also fixes it on my end. How long has it been like this? 🤔

I have updated the README.md file 17 days ago 😅 Ref: 1027eec

@mgrachev yeah, I think the reason is tripped up a few of us is because it was a breaking change BUT it broke silently. We had no idea the check was not actually working since it just returned 0 rubocop errors.

I've just gone though all our repos and updated the workflows so all good but maybe for these kind of changes, make it clear it's a breaking change. Do appreciate your work on this though, this action is GOLD.

adnikiforov commented 3 years ago

It seems like on self-hosted runners there might be an issues with permissions; thing that didn't really exist in docker-based action. I have an error like this:

Run ruby/setup-ruby@v1
  with:
    ruby-version: default
    bundler: default
    bundler-cache: false
    working-directory: .
  env:
    ImageOS: ubuntu18
Using 2.7.2 as input from file .ruby-version

Error: EACCES: permission denied, mkdir '/opt/hostedtoolcache'

At the moment I've pinned version to 1.7.1 to fix that; I'm gonna investigate this issue later. Might be a purely my side issue, but I'm not 100% sure.

mgrachev commented 3 years ago

You should add permission to write for the /opt/hostedtoolcache directory. More information here: https://github.com/ruby/setup-ruby#using-self-hosted-runners