diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 00000000..b0b0f024 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,24 @@ +name: Check code format + +on: ['push'] + +jobs: + check-format: + runs-on: ubuntu-latest + steps: + - name: Checkout this repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: Ana06/get-changed-files@v2.1.0 + with: + filter: '*.lua' + + - uses: leafo/gh-actions-lua@v9 + - uses: leafo/gh-actions-luarocks@v4 + - name: Install LuaFormat + run: | + luarocks install --server=https://luarocks.org/dev luaformatter + - name: Check formatting + run: | + ./lua-format {{ steps.files.outputs.added_modified }} -c ./luaconfig.config --check