From 38e2dd208e0adec2700ee0765da5e7735add986c Mon Sep 17 00:00:00 2001 From: Karine Vieira Date: Sun, 23 Jun 2024 16:50:32 -0300 Subject: [PATCH 1/2] config: lint pr --- .github/workflows/ci.yml | 17 +++++++++++++++++ spec/models/user_spec.rb | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17d8ed8..712db09 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,23 @@ jobs: with: bundler-cache: true + - name: Get file changes + id: get_file_changes + uses: trilom/file-changes-action@v1.2.3 + with: + output: ' ' + + - name: Echo file changes + run: | + echo Changed files: ${{ steps.get_file_changes.outputs.files }} + + - name: Lint Pull Request + uses: wearerequired/lint-action@v2 + with: + rubocop: true + rubocop_args: --fail-level C --display-only-fail-level-offenses ${{ steps.get_file_changes.outputs.files}} + rubocop_command_prefix: bundle exec + - name: Lint Ruby files run: bundle exec rubocop diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 477cce2..a071b00 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -11,7 +11,7 @@ it { is_expected.to accept_nested_attributes_for(:profile) } end - describe "validations" do + describe 'validations' do it { is_expected.to validate_presence_of(:profile) } end end From 2f4a5cd8583b19f70df286a38f979f21a8674782 Mon Sep 17 00:00:00 2001 From: Karine Vieira Date: Sun, 23 Jun 2024 17:19:18 -0300 Subject: [PATCH 2/2] config: lint pr --- .github/workflows/ci.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 712db09..d7c19c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,15 +19,22 @@ jobs: with: output: ' ' - - name: Echo file changes + - name: Filter Ruby files + id: filter_ruby_files run: | - echo Changed files: ${{ steps.get_file_changes.outputs.files }} + files="${{ steps.get_file_changes.outputs.files }}" + ruby_files=$(echo "$files" | tr ' ' '\n' | grep '\.rb$' | tr '\n' ' ') + echo "::set-output name=ruby_files::$ruby_files" + + - name: Echo Ruby file changes + run: | + echo Changed Ruby files: ${{ steps.filter_ruby_files.outputs.ruby_files }} - name: Lint Pull Request uses: wearerequired/lint-action@v2 with: rubocop: true - rubocop_args: --fail-level C --display-only-fail-level-offenses ${{ steps.get_file_changes.outputs.files}} + rubocop_args: --fail-level C --display-only-fail-level-offenses ${{ steps.filter_ruby_files.outputs.ruby_files }} rubocop_command_prefix: bundle exec - name: Lint Ruby files