Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Rubocop

on: [pull_request]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

# Extract the Ruby version from the Gemfile.lock
- name: 'Determine Ruby Version'
run: echo ::set-env name=RUBY_VERSION::$(echo `cat ./Gemfile.lock | grep -A 1 'RUBY VERSION' | grep 'ruby' | grep -oE '[0-9]\.[0-9]'`)

# Install Ruby - using the version found in the Gemfile.lock
- name: 'Install Ruby'
uses: actions/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}

# Will run Rubocop checks on the PR diffs and report any errors as commentary on the PR
- name: Octocop
uses: Freshly/Octocop@v0.0.1
with:
github_token: ${{ secrets.github_token }}
rubocop_flags: "-c ./rubocop.yml"