Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .github/workflows/reusable-ruby-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ on:
description: Optional GitHub App installation ID
required: false
type: string
rubocopEnabled:
required: false
type: boolean
default: false
workingDirectory:
description: Working direction for action
default: ./
Expand Down Expand Up @@ -171,8 +167,15 @@ jobs:
bin/bundle
fi

- name: Check if Rubocop is present
id: rubocop
run: |
if test -f "bin/rubocop"; then
echo "rubocop_enabled=true" >> "$GITHUB_OUTPUT"
fi

- name: Prepare RuboCop cache
if: ${{ !cancelled() && inputs.rubocopEnabled == true }}
if: ${{ !cancelled() && steps.rubocop.outputs.rubocop_enabled == 'true' }}
uses: actions/cache@v4
env:
DEPENDENCIES_HASH: ${{ hashFiles('.ruby-version', '**/.rubocop.yml', '**/.rubocop_todo.yml', 'Gemfile.lock') }}
Expand All @@ -183,7 +186,7 @@ jobs:
rubocop-${{ runner.os }}-${{ env.DEPENDENCIES_HASH }}-

- name: Lint
if: ${{ !cancelled() && inputs.rubocopEnabled == true }}
if: ${{ !cancelled() && steps.rubocop.outputs.rubocop_enabled == 'true' }}
env:
CHANGED_FILES: ${{ steps.changed_files.outputs.all_changed_files }}
run: |
Expand Down
Loading