Closed milani closed 1 year ago
When I use the action like below:
name: Lint on: pull_request: types: - opened - edited - synchronize jobs: rubocop: runs-on: ubuntu-latest steps: - name: Git checkout uses: actions/checkout@v3 - name: Set up ruby uses: ruby/setup-ruby@v1 with: ruby-version: 3.2.2 bundler-cache: true - name: Rubocop Linter uses: wearerequired/lint-action@v2 with: git_name: 'Lint Autocorrect' git_email: 'lint-autocorrect@example.com' github_token: ${{ secrets.GITHUB_TOKEN }} rubocop: true auto_fix: false rubocop_command_prefix: bundle exec rubocop_args: "--fail-level r" # fail even for Refactor level cops
I receive an error:
Verifying setup for RuboCop… bundler: failed to load command: rubocop (/home/runner/work/example/example/vendor/bundle/ruby/3.2.0/bin/rubocop)
I verified that rubocop is installed by adding - run: bundle exec rubocop -v between setup-ruby and Rubocop Linter steps.
- run: bundle exec rubocop -v
setup-ruby
Rubocop Linter
I believe this happens because setup-ruby installs gems in vendor directory:
/opt/hostedtoolcache/Ruby/3.2.2/x64/bin/bundle config --local path /home/runner/work/example/example/vendor/bundle /opt/hostedtoolcache/Ruby/3.2.2/x64/bin/bundle config --local deployment true
and lint-action checks out the branch:
lint-action
Switching to the "chore-rubocop-action" branch * branch chore-rubocop-action -> FETCH_HEAD * [new branch] chore-rubocop-action -> origin/chore-rubocop-action
So maybe vendor folder disappears here?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
When I use the action like below:
I receive an error:
I verified that rubocop is installed by adding
- run: bundle exec rubocop -v
betweensetup-ruby
andRubocop Linter
steps.I believe this happens because
setup-ruby
installs gems in vendor directory:and
lint-action
checks out the branch:So maybe vendor folder disappears here?