-
Notifications
You must be signed in to change notification settings - Fork 68
42 lines (39 loc) · 1.57 KB
/
slash_commands.yml
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
# Usage
# This generic dispatcher expects slash commands in an issue or PR comment whose first
# line starts with `/`.
#
# The dispatcher will send commands to a separate workflow event, which will take the
# repo ID and the comment ID as input variables.
name: Slash commands dispatcher
on:
issue_comment:
types: [created]
jobs:
slash_command_dispatch:
runs-on: ubuntu-latest
steps:
- name: Slash Command Dispatch
id: command-dispatch
uses: peter-evans/slash-command-dispatch@v4
with:
# https://github.com/peter-evans/slash-command-dispatch
token: ${{ secrets.MELTYBOT_GITHUB_AUTH_TOKEN }}
dispatch-type: workflow
reactions: false # Otherwise 👀 and 🚀 will immediately be posted to the comment.
issue-type: "both" # pull-requests and issues
permission: # GitHub users need at least this permission level on the repo
write
commands: | # What commands should be accepted
test-plugin
static-args: | # These first two are required for proper context
repository=${{ github.repository }}
comment-id=${{ github.event.comment.id }}
issue-number=${{ github.event.issue.number }}
from-slash-command=true
- name: Edit comment with error message
if: steps.command-dispatch.outputs.error-message
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ github.event.comment.id }}
body: |
> ${{ steps.command-dispatch.outputs.error-message }}