-
Notifications
You must be signed in to change notification settings - Fork 14
48 lines (42 loc) · 1.31 KB
/
rubocop.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Rubocop
on:
push:
branches:
- '*'
- '**/*'
concurrency:
group: ${{ github.ref }}-rubocop
cancel-in-progress: true
jobs:
rubocop:
name: Rubocop
# Containers must run in Linux based operating systems
runs-on: ubuntu-20.04
# Docker Hub image that the job executes in
container: ruby:3.1.6-alpine3.20
steps:
- uses: actions/checkout@v4
- name: 'Container Setup'
id: container-setup
uses: ./.github/workflows/container_setup
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
- id: rubocop
name: Run Rubocop
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
ignore_patterns="db/schema.rb\|bin/rails\|bin/rake\|bin/bundle"
files=`echo "${ALL_CHANGED_FILES}" | tr " " "\n" | grep -v $ignore_patterns | grep "**/*.rb" | tr "\n" " ./"`
num=`echo $files | wc -w`
echo $files
if [ $num -gt 0 ]; then bundle exec rubocop --config ./.rubocop.yml $files; else echo "No changed ruby files"; fi
- id: eslint
name: Run ESLint
run: |
yarn install --frozen-lockfile
yarn lint --quiet