From 9a7d199b59abf12fdb24b3c1eaeb830d13ea0771 Mon Sep 17 00:00:00 2001 From: TSR Berry <20988865+TSRBerry@users.noreply.github.com> Date: Sat, 19 Aug 2023 23:16:27 +0200 Subject: [PATCH] Add formatting workflow --- .github/workflows/format.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/format.yml diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 0000000..404539a --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,33 @@ +name: Format + +on: + push: + +jobs: + black: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Configure git + run: | + git config --global user.name "ryujinx-mako[bot]" + git config --global user.email "142357924+ryujinx-mako[bot]@users.noreply.github.com" + + - uses: psf/black@stable + with: + options: "--verbose" + + - name: Check if files have been modified + id: mod_check + run: | + [[ $(git status -s | wc -l) -le 1 ]] \ + && echo "is-dirty=false" >> "$GITHUB_OUTPUT" \ + || echo "is-dirty=true" >> "$GITHUB_OUTPUT" + + - name: Commit and push changes + if: steps.mod_check.outputs.is-dirty == 'true' + run: | + git add . + git commit -m "Apply black formatting" + git push