dry-validation/.github/workflows/rubocop.yml

47 lines
963 B
YAML

name: "RuboCop"
on:
push:
branches:
- "main"
- "main"
paths:
- "**/*.rb"
- "**/*.rake"
- "Rakefile"
- "Gemfile*"
- ".rubocop.yml"
pull_request:
branches:
- "main"
- "main"
types:
- "opened"
- "synchronize"
workflow_dispatch:
jobs:
run:
runs-on: ubuntu-latest
name: ${{ matrix.type }}
strategy:
fail-fast: false
matrix:
type: ["Style", "Layout", "Naming", "Lint", "Metrics", "Security"]
steps:
- name: Clone
uses: actions/checkout@v2
- name: Get git diff
id: get_diff
uses: technote-space/get-diff-action@v4
with:
PATTERNS: |
**/*.rb
**/*.rake
Gemfile
Rakefile
- name: Check ${{ matrix.type }}
uses: action-hero/actions/rubocop@main
if: ${{ env.GIT_DIFF != '' }}
with:
diff: ${{ env.GIT_DIFF }}
type: ${{ matrix.type }}