From 311413d382625613ef09036336fb89dbd4d3c7e7 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Sat, 26 Oct 2024 10:06:46 +0800 Subject: Actions workflow to format code on command (#5400) * Add script to perform or check formatting * Actions workflow to format code on command Comment on a PR with /format --- .github/workflows/slash-command-dispatch.yml | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/slash-command-dispatch.yml (limited to '.github/workflows/slash-command-dispatch.yml') diff --git a/.github/workflows/slash-command-dispatch.yml b/.github/workflows/slash-command-dispatch.yml new file mode 100644 index 000000000..fc357f89e --- /dev/null +++ b/.github/workflows/slash-command-dispatch.yml @@ -0,0 +1,32 @@ +name: Slash Command Dispatch +on: + issue_comment: + types: [created] +jobs: + slashCommandDispatch: + runs-on: ubuntu-latest + steps: + + - name: Slash Command Dispatch + id: scd + uses: peter-evans/slash-command-dispatch@v4 + with: + token: ${{ secrets.SLANGBOT_PAT }} + reaction-token: ${{ secrets.SLANGBOT_PAT }} + config: > + [ + { + "command": "format", + "permission": "none", + "issue_type": "pull-request" + } + ] + + - name: Edit comment with error message + if: steps.scd.outputs.error-message + uses: peter-evans/create-or-update-comment@v4 + with: + token: ${{ secrets.SLANGBOT_PAT }} + comment-id: ${{ github.event.comment.id }} + body: | + > ${{ steps.scd.outputs.error-message }} -- cgit v1.2.3