2021-10-04 00:41:57 -04:00
|
|
|
name: formatting
|
2021-08-26 23:27:58 -04:00
|
|
|
on:
|
|
|
|
push:
|
2021-10-04 00:41:57 -04:00
|
|
|
paths-ignore:
|
|
|
|
- ".github/**"
|
|
|
|
- "*.md"
|
2021-08-26 23:46:10 -04:00
|
|
|
branches: "**"
|
2021-08-26 23:27:58 -04:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
stylua:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-10-04 00:41:57 -04:00
|
|
|
- uses: JohnnyMorganz/stylua-action@1.0.0
|
2021-08-26 23:27:58 -04:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2021-10-04 00:41:57 -04:00
|
|
|
args: --config-path=./.stylua.toml -g *.lua -g !lua/core/*.lua -g !lua/plugins/**/*.lua -g !lua/colors/*.lua -- .
|
2021-08-26 23:27:58 -04:00
|
|
|
- name: Commit files
|
|
|
|
run: |
|
|
|
|
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
|
|
git config --local user.name "github-actions[bot]"
|
2021-10-04 00:41:57 -04:00
|
|
|
if ! [[ -z $(git status -s) ]]; then
|
|
|
|
git commit --all -m "chore: format with stylua" init.lua lua/**
|
2021-08-26 23:27:58 -04:00
|
|
|
fi
|
2021-10-04 00:41:57 -04:00
|
|
|
- name: Push changes
|
2021-08-26 23:27:58 -04:00
|
|
|
uses: ad-m/github-push-action@master
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
branch: ${{ github.ref }}
|