2021-08-26 23:46:10 -04:00
|
|
|
name: format
|
2021-08-26 23:27:58 -04:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2021-08-26 23:46:10 -04:00
|
|
|
branches: "**"
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- "main"
|
|
|
|
- "develop"
|
2021-08-26 23:27:58 -04:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
stylua:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Setup and run stylua
|
|
|
|
uses: JohnnyMorganz/stylua-action@1.0.0
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
args: --config-path=./.stylua.toml -g *.lua -g !lua/core/**/*.lua -g !lua/modules/**/*.lua -g !lua/utils/*.lua -- .
|
|
|
|
- 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]"
|
|
|
|
if [[ ! -z $(git status -s) ]]; then
|
|
|
|
git add .
|
|
|
|
git commit -m "chore: format source code"
|
|
|
|
fi
|
|
|
|
- name: Push formatted files
|
|
|
|
uses: ad-m/github-push-action@master
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
branch: ${{ github.ref }}
|