my-nvim-setup/.github/workflows/format.yml

30 lines
920 B
YAML
Raw Normal View History

name: formatting
2021-08-27 04:27:58 +01:00
on:
push:
paths-ignore:
- ".github/**"
- "*.md"
2021-08-27 04:46:10 +01:00
branches: "**"
2021-08-27 04:27:58 +01:00
jobs:
stylua:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: JohnnyMorganz/stylua-action@1.0.0
2021-08-27 04:27:58 +01:00
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --config-path=./.stylua.toml -g *.lua -g !lua/core/*.lua -g !lua/plugins/**/*.lua -g !lua/colors/*.lua -- .
2021-08-27 04:27:58 +01: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]"
if [[ -n $(git status -s) ]]; then
git commit --all --message "chore: format with stylua"
2021-08-27 04:27:58 +01:00
fi
- name: Push changes
2021-08-27 04:27:58 +01:00
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}