Skip to content

Commit 257e6fb

Browse files
committed
hotfix(ci): fix stylua autoformatting action
Also updated actions version and simplified formatting workflow
1 parent 1672279 commit 257e6fb

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

.github/workflows/format.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@ name: format
33
on:
44
push:
55
branches: [main]
6+
paths-ignore:
7+
- ".github/**"
8+
- "**.md"
69

710
jobs:
811
stylua:
912
runs-on: ubuntu-latest
1013
steps:
1114
- uses: actions/checkout@v2
1215
- name: Setup and run stylua
13-
uses: JohnnyMorganz/stylua-action@1.0.0
16+
uses: JohnnyMorganz/stylua-action@v3
1417
with:
1518
token: ${{ secrets.GITHUB_TOKEN }}
1619
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 lua/
23-
git commit -m "Format source code"
24-
fi
20+
- name: Commit changes
21+
uses: stefanzweifel/git-auto-commit-action@v4
22+
with:
23+
commit_message: "chore: autoformat with stylua"
24+
branch: ${{ github.ref }}
2525
- name: Push formatted files
2626
uses: ad-m/github-push-action@master
2727
with:

stylua.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
column_width = 100
1+
column_width = 120
22
line_endings = "Unix"
33
indent_type = "Spaces"
44
indent_width = 2
55
quote_style = "AutoPreferDouble"
6+
call_parentheses = "Always"

0 commit comments

Comments
 (0)