-
-
Notifications
You must be signed in to change notification settings - Fork 53
121 lines (117 loc) · 4.27 KB
/
slash-command-dispatch.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Slash Command Dispatch
on:
issue_comment:
# Type "edited" added here for test purposes. Where possible, avoid
# using to prevent processing unnecessary events.
types: [created, edited]
jobs:
slashCommandDispatch:
runs-on: ubuntu-latest
steps:
# Checkout is necessary here due to referencing a local action.
# It's also necessary when using the 'config-from-file' option.
# Otherwise, avoid using checkout to keep this workflow fast.
- uses: actions/checkout@v4
# Basic configuration
- name: Slash Command Dispatch
uses: ./
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
commands: |
hello-world-local
ping-local
permission: none
issue-type: issue
# Advanced JSON configuration
- name: Slash Command Dispatch (JSON)
id: scd
uses: ./
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
config: >
[
{
"command": "rebase",
"permission": "admin",
"repository": "peter-evans/slash-command-dispatch-processor",
"issue_type": "pull-request"
},
{
"command": "help",
"permission": "none",
"issue_type": "issue",
"repository": "peter-evans/slash-command-dispatch-processor"
},
{
"command": "help",
"permission": "none",
"issue_type": "pull-request",
"repository": "peter-evans/slash-command-dispatch-processor",
"event_type_suffix": "-pr-command"
},
{
"command": "example",
"permission": "none",
"issue_type": "issue",
"repository": "peter-evans/slash-command-dispatch-processor"
},
{
"command": "hello-world",
"permission": "none",
"issue_type": "issue",
"repository": "peter-evans/slash-command-dispatch-processor"
},
{
"command": "hello-world",
"permission": "none",
"issue_type": "pull-request",
"repository": "peter-evans/slash-command-dispatch-processor",
"event_type_suffix": "-pr-command"
},
{
"command": "hello-workflow",
"permission": "none",
"issue_type": "issue",
"repository": "peter-evans/slash-command-dispatch-processor",
"static_args": [
"repository=${{ github.repository }}",
"comment-id=${{ github.event.comment.id }}",
"issue-number=${{ github.event.issue.number }}",
"actor=${{ github.actor }}"
],
"dispatch_type": "workflow"
},
{
"command": "ping",
"permission": "none",
"issue_type": "issue",
"repository": "peter-evans/slash-command-dispatch-processor"
},
{
"command": "black",
"permission": "none",
"issue_type": "pull-request",
"repository": "peter-evans/slash-command-dispatch-processor"
},
{
"command": "reset-demo",
"permission": "none",
"issue_type": "pull-request",
"repository": "peter-evans/slash-command-dispatch-processor"
}
]
- name: Edit comment with error message
if: steps.scd.outputs.error-message
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ github.event.comment.id }}
body: |
> ${{ steps.scd.outputs.error-message }}
# Advanced JSON configuration from file
# (These commands do not do anything and are just a reference example)
- name: Slash Command Dispatch (JSON file)
uses: ./
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
reactions: false
config-from-file: .github/slash-command-dispatch.json