From b75dddd1a7044b2d7f3e4ac120d5d984a910a05c Mon Sep 17 00:00:00 2001 From: Javier Julio Date: Thu, 11 Jan 2024 18:06:03 -0500 Subject: [PATCH] Create rubocop.yml --- .github/workflows/rubocop.yml | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/rubocop.yml diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml new file mode 100644 index 0000000..3a92872 --- /dev/null +++ b/.github/workflows/rubocop.yml @@ -0,0 +1,43 @@ +name: Rubocop + +on: + pull_request: + +env: + RUBY_VERSION: ${{ vars.RUBOCOP_RUBY_VERSION || '3.2' }} + +jobs: + rubocop: + name: Run rubocop + runs-on: ubuntu-latest + env: + BUNDLE_ONLY: ${{ vars.RUBOCOP_BUNDLE_ONLY || 'rubocop' }} + steps: + - uses: actions/checkout@v4 + - uses: tj-actions/changed-files@v41 + id: changed-files + with: + files: | + .github/workflows/rubocop.yml + .rubocop.yml + **.rb + **.arb + bin/* + docs/Gemfile + gemfiles/**/Gemfile + Gemfile* + Rakefile + *.gemspec + - uses: ruby/setup-ruby@v1 + if: steps.changed-files.outputs.any_changed == 'true' + with: + ruby-version: ${{ env.RUBY_VERSION }} + bundler-cache: true + - uses: reviewdog/action-rubocop@v2 + if: steps.changed-files.outputs.any_changed == 'true' + with: + fail_on_error: true + filter_mode: nofilter # added (default), diff_context, file, nofilter + github_token: ${{ secrets.GITHUB_TOKEN }} + skip_install: true + use_bundler: true