-
Notifications
You must be signed in to change notification settings - Fork 14.2k
65 lines (65 loc) · 1.77 KB
/
lint.yml
File metadata and controls
65 lines (65 loc) · 1.77 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# name: Lint
#
# on:
# pull_request_target:
# workflow_dispatch:
# merge_group:
#
# jobs:
# lint:
# runs-on: ubuntu-latest
# permissions:
# contents: read
# steps:
# - uses: actions/[email protected]
# with:
# ref: ${{ github.event.pull_request.head.sha || github.ref }}
# repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
#
# - name: Setup Ruby
# uses: ruby/[email protected]
# with:
# bundler-cache: false
#
# - name: Install dependencies
# run: bundle install
#
# - name: Run RuboCop
# run: |
# bundle exec rubocop
#
# autocorrect:
# if: github.event.pull_request.head.repo.full_name == github.repository
# runs-on: ubuntu-latest
# permissions:
# contents: write
# steps:
# - uses: actions/[email protected]
# with:
# ref: ${{ github.event.pull_request.head.ref || github.ref }}
#
# - name: Setup Ruby
# uses: ruby/[email protected]
# with:
# bundler-cache: true
#
# - name: Run RuboCop with auto-correct
# run: |
# bundle exec rubocop -A
#
# - name: Check for changes
# run: |
# git config --global user.name "github-actions[bot]"
# git config --global user.email "github-actions[bot]@users.noreply.github.com"
# if git status --porcelain | grep .; then
# echo "changes=true" >> $GITHUB_ENV
# else
# echo "changes=false" >> $GITHUB_ENV
# fi
#
# - name: Commit and push changes
# if: env.changes == 'true'
# run: |
# git add .
# git commit -m "chore: auto-corrected with RuboCop"
# git push