Ru-b2-SQL-Backups/.github/workflows/ruby.yml

42 lines
1.1 KiB
YAML
Raw Normal View History

2023-02-28 11:11:08 -07:00
name: Ruby
on:
push:
branches: [ "main" ]
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.2']
2023-02-28 11:11:08 -07:00
steps:
- uses: actions/checkout@v3
- 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 Rubocops latest version
run: gem install rubocop
- name: Run tests
run: rubocop -A --fail-level warn
- 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:
title: "Apply RuboCop auto-correct"
branch: "rubocop-autocorrect"
delete-branch: true
body: "This PR applies RuboCop auto-corrections to the codebase."