-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (38 loc) · 1.25 KB
/
RuboCop-Auto-correct.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
name: RuboCop Auto-correct
on:
push:
branches: [ "development" ]
jobs:
autocorrect:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.2']
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- 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
- name: Install RuboCop
run: gem install rubocop
- name: Run RuboCop
run: rubocop -A --fail-level warn
- name: Commit changes
run: |
git config --local user.email "[email protected]"
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:
token: ${{ secrets.RUBOCOP_CHECKS }}
title: "Apply RuboCop auto-correct"
branch: "rubocop-autocorrect-${{ github.run_number }}"
base: "development"
delete-branch: true
body: "This PR applies RuboCop auto-corrections to the codebase."