2023-07-27 18:33:04 -06:00
|
|
|
name: RuboCop Auto-correct
|
2023-02-28 11:11:08 -07:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-07-27 19:12:33 -06:00
|
|
|
branches: [ "development" ]
|
2023-02-28 11:11:08 -07:00
|
|
|
|
|
|
|
jobs:
|
2023-07-27 18:33:04 -06:00
|
|
|
autocorrect:
|
2023-02-28 11:11:08 -07:00
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-07-27 17:58:27 -06:00
|
|
|
ruby-version: ['3.2']
|
2023-02-28 11:11:08 -07:00
|
|
|
|
|
|
|
steps:
|
2023-07-27 18:33:04 -06:00
|
|
|
- uses: actions/checkout@v2
|
2023-07-27 18:55:36 -06:00
|
|
|
with:
|
2023-07-27 19:03:13 -06:00
|
|
|
token: ${{ secrets.RUBOCOP_CHECKS }}
|
2023-02-28 11:11:08 -07:00
|
|
|
- name: Set up Ruby
|
|
|
|
uses: ruby/setup-ruby@ee2113536afb7f793eed4ce60e8d3b26db912da4 # v1.127.0
|
|
|
|
with:
|
|
|
|
ruby-version: ${{ matrix.ruby-version }}
|
|
|
|
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
2023-07-27 18:33:04 -06:00
|
|
|
- name: Install RuboCop
|
2023-07-27 18:01:56 -06:00
|
|
|
run: gem install rubocop
|
2023-07-27 18:33:04 -06:00
|
|
|
- name: Run RuboCop
|
2023-07-27 18:06:00 -06:00
|
|
|
run: rubocop -A --fail-level warn
|
2023-07-27 18:10:50 -06:00
|
|
|
- name: Commit changes
|
|
|
|
run: |
|
|
|
|
git config --local user.email "action@github.com"
|
|
|
|
git config --local user.name "GitHub Action"
|
|
|
|
git add -A
|
|
|
|
git commit -m "Apply RuboCop auto-correct" || echo "No changes to commit"
|
|
|
|
- name: Create Pull Request
|
|
|
|
uses: peter-evans/create-pull-request@v3
|
|
|
|
with:
|
2023-07-27 19:12:33 -06:00
|
|
|
token: ${{ secrets.RUBOCOP_CHECKS }}
|
2023-07-27 18:10:50 -06:00
|
|
|
title: "Apply RuboCop auto-correct"
|
2023-07-27 18:33:04 -06:00
|
|
|
branch: "rubocop-autocorrect-${{ github.run_number }}"
|
2023-07-27 19:12:33 -06:00
|
|
|
base: "development"
|
2023-07-27 18:10:50 -06:00
|
|
|
delete-branch: true
|
|
|
|
body: "This PR applies RuboCop auto-corrections to the codebase."
|