forked from nvim-neorg/neorg
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (40 loc) · 1.2 KB
/
stylua.yml
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
name: Formatting
on:
push:
branches: [ "main" ]
paths-ignore:
- ".github/**"
- "**.md"
- "**.norg"
jobs:
format-with-stylua:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache cargo modules
id: cache-cargo
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.cargo
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install cargo
run: curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: Install stylua
run: cargo install stylua --features lua52
- name: Run formatting
run: stylua -v --verify .
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "chore: autoformat with stylua"
branch: ${{ github.ref }}
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}