Sha256: ef7721c5118af04346dbf00fe67f15a6f97c1ac7f96dd0f9071c28ffe960aca4
Contents?: true
Size: 740 Bytes
Versions: 21
Compression:
Stored size: 740 Bytes
Contents
#!/usr/bin/env bash # set -x DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" commit_range="${1:-main}" if [ ! -z "$2" ]; then commit_range="$commit_range..$2" fi echo "Checking $commit_range" # https://dev.to/scienta/get-changed-files-in-github-actions-1p36 changed_ruby_files=$(git diff --name-only --diff-filter=ACMRT $commit_range | grep -E "(lib\/|spec\/).*\.rb$" | xargs) if [[ -z "${changed_ruby_files// }" ]]; then echo "No files to lint with Rubocop" else docker run -v $DIR/..:/code \ -w /code \ openstax/kitchen.ci:latest \ /bin/bash -c "bundle config path vendor/bundle; bundle install; bundle exec rubocop $changed_ruby_files --disable-pending-cops" fi
Version data entries
21 entries across 21 versions & 1 rubygems