Skip to content

Commit 28a146d

Browse files
committed
feat: add formatting CI so I don't have to care about formatting myself
1 parent c3b76f2 commit 28a146d

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/format.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: format
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
stylua:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Setup and run stylua
13+
uses: JohnnyMorganz/stylua-action@1.0.0
14+
with:
15+
token: ${{ secrets.GITHUB_TOKEN }}
16+
args: --config-path=stylua.toml .
17+
- name: Commit files
18+
run: |
19+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
20+
git config --local user.name "github-actions[bot]"
21+
if [[ ! -z $(git status -s) ]]; then
22+
git add init.lua lua/
23+
git commit -m "Format source code"
24+
fi
25+
- name: Push formatted files
26+
uses: ad-m/github-push-action@master
27+
with:
28+
github_token: ${{ secrets.GITHUB_TOKEN }}
29+
branch: ${{ github.ref }}

0 commit comments

Comments
 (0)