@ -1,6 +1,9 @@
name : format
name : format ting
on :
on :
push:
push:
paths-ignore:
- ".github/**"
- "*.md"
branches : "**"
branches : "**"
jobs:
jobs:
@ -8,20 +11,18 @@ jobs:
runs-on : ubuntu-latest
runs-on : ubuntu-latest
steps:
steps:
- uses : actions/checkout@v2
- uses : actions/checkout@v2
- name : Setup and run stylua
- uses : JohnnyMorganz/stylua-action@1.0.0
uses : JohnnyMorganz/stylua-action@1.0.0
with:
with:
token : ${{ secrets.GITHUB_TOKEN }}
token : ${{ secrets.GITHUB_TOKEN }}
args : --config-path=./.stylua.toml -g *.lua -g !lua/core/* */*.lua -g !lua/modules/**/*.lua -g !lua/util s/*.lua -- .
args : --config-path=./.stylua.toml -g *.lua -g !lua/core/* .lua -g !lua/plugins/**/*.lua -g !lua/color s/*.lua -- .
- name : Commit files
- name : Commit files
run : |
run : |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git config --local user.name "github-actions[bot]"
if [[ ! -z $(git status -s) ]]; then
if ! [[ -z $(git status -s) ]]; then
git add .
git commit --all -m "chore: format with stylua" init.lua lua/**
git commit -m "chore: format source code"
fi
fi
- name : Push formatted fil es
- name : Push chang es
uses : ad-m/github-push-action@master
uses : ad-m/github-push-action@master
with:
with:
github_token : ${{ secrets.GITHUB_TOKEN }}
github_token : ${{ secrets.GITHUB_TOKEN }}