-
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add formatting CI so I don't have to care about formatting myself
- Loading branch information
1 parent
c3b76f2
commit 28a146d
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: format | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
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 . | ||
- 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 init.lua lua/ | ||
git commit -m "Format source code" | ||
fi | ||
- name: Push formatted files | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ github.ref }} |