From eed3bd8154bd7ad77190d72a5bb00f8d46b3d9e8 Mon Sep 17 00:00:00 2001 From: Daniel D'Avella Date: Thu, 14 Mar 2024 12:25:34 -0400 Subject: [PATCH] Add action to automatically format Pixeebot PRs --- .../workflows/autoformat-pixeebot-prs.yaml | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/autoformat-pixeebot-prs.yaml diff --git a/.github/workflows/autoformat-pixeebot-prs.yaml b/.github/workflows/autoformat-pixeebot-prs.yaml new file mode 100644 index 00000000..90590a58 --- /dev/null +++ b/.github/workflows/autoformat-pixeebot-prs.yaml @@ -0,0 +1,32 @@ +name: Format Pixeebot PRs + +on: + pull_request: + types: [opened, synchronize] + +jobs: + apply-black: + if: github.event.pull_request.user.login == 'pixeebot[bot]' + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install black + run: pip install black + + - name: Apply black formatting + run: black . + + - name: Commit and push changes + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: ":art: Apply formatting"