From fe58b5f1c3cef31223413c1f7474df2bd45d6701 Mon Sep 17 00:00:00 2001 From: Chris Grieser <73286100+chrisgrieser@users.noreply.github.com> Date: Sat, 1 Jun 2024 16:35:29 +0200 Subject: [PATCH] ci: new stylua action that only runs on push --- .github/PULL_REQUEST_TEMPLATE.md | 1 - .github/workflows/stylua.yml | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/stylua.yml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 97f38cd..3c4364a 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -2,4 +2,3 @@ - [ ] Used only camelCase variable names. - [ ] If functionality is added or modified, also made respective changes to the `README.md` (the `.txt` file is auto-generated and does not need to be modified). -- [ ] If a non-trivial PR, formatting via `stylua`. diff --git a/.github/workflows/stylua.yml b/.github/workflows/stylua.yml new file mode 100644 index 0000000..2fe11eb --- /dev/null +++ b/.github/workflows/stylua.yml @@ -0,0 +1,20 @@ +name: Format with Stylua + +on: + push: + branches: [ main ] + paths: [ '**.lua' ] + +jobs: + postprocessing: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: JohnnyMorganz/stylua-action@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: latest + args: --check . + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "style: format with stylua"