summaryrefslogtreecommitdiffstats
path: root/.github/workflows/slash-command-dispatch.yml
blob: 5d54da511f8071330edc3b6f779d50ad1d968249 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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.GITHUB_TOKEN }}
          reaction-token: ${{ secrets.SLANGBOT_PAT }}
          issue-type: pull-request
          config: >
            [
              {
                "command": "format",
                "permission": "none",
                "issue_type": "pull-request"
              },
              {
                "command": "regenerate-toc",
                "permission": "none",
                "issue_type": "pull-request"
              },
              {
                "command": "regenerate-cmdline-ref",
                "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 }}