-
Notifications
You must be signed in to change notification settings - Fork 226
62 lines (55 loc) · 1.93 KB
/
Copy pathlint-lua.yml
File metadata and controls
62 lines (55 loc) · 1.93 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
name: lua-style
on:
workflow_dispatch:
push:
branches: [ develop, release, test ]
#pull_request:
# branches: [ develop, release, test ]
# minimal perms to allow auto-commit on push
permissions:
contents: write
jobs:
lua-style:
name: style linters
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v5
with:
# lets auto-commit push back to the same branch
ref: ${{ github.head_ref }}
# Formatting (StyLua)
# check-only on PRs
- name: StyLua (check)
if: ${{ github.event_name == 'pull_request' }}
uses: JohnnyMorganz/stylua-action@v4
with:
token: ${{ secrets.IKEMEN_TOKEN }}
version: v2.3.1
args: --config-path .github/.stylua.toml --check .
# write fixes on branch pushes
- name: StyLua (write)
if: ${{ github.event_name != 'pull_request' }}
uses: JohnnyMorganz/stylua-action@v4
with:
token: ${{ secrets.IKEMEN_TOKEN }}
version: v2.3.1
args: --config-path .github/.stylua.toml .
# Linting (Luacheck)
- name: Luacheck
uses: lunarmodules/luacheck@v1
continue-on-error: true
with:
# pass extra args if you have a .luacheckrc
args: . --no-color --ignore 111 --ignore 112 --ignore 113 --ignore 142 --ignore 143
# Commit format changes on push
- name: Commit formatting changes
if: ${{ github.event_name != 'pull_request' }}
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "style(lua): fix code style issues with StyLua"
commit_user_name: lint-action
commit_user_email: 59283862+lint-action@users.noreply.github.com
commit_author: "lint-action <59283862+lint-action@users.noreply.github.com>"
file_pattern: "**/*.lua"