You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+54-95Lines changed: 54 additions & 95 deletions
Original file line number
Diff line number
Diff line change
@@ -13,16 +13,7 @@ When a valid command is found it creates a repository dispatch event that includ
13
13
"ChatOps" with slash commands can work in a basic way by parsing the commands during `issue_comment` events and immediately processing the command.
14
14
In repositories with a lot of activity, the workflow queue will get backed up very quickly if it is trying to handle new comments for commands *and* process the commands themselves.
15
15
16
-
Dispatching commands to be processed elsewhere keeps the workflow queue moving quickly. It essentially allows you to run multiple workflow queues in parallel.
17
-
18
-
### Key features
19
-
20
-
- Easy configuration of "ChatOps" slash commands
21
-
- Enables separating the queue of `issue_comment` events from the queue of dispatched commands to keep it fast moving
22
-
- Users receive faster feedback that commands have been seen and are waiting to be processed
23
-
- The ability to handle processing commands in multiple repositories in parallel
24
-
- Long running workloads can be processed in a repository workflow queue of their own
25
-
- Even if commands are dispatched and processed in the same repository, separation of comment parsing and command processing makes workflows more maintainable, and with less duplication
16
+
Dispatching commands to be processed elsewhere keeps the workflow queue moving quickly. It essentially enables parallel processing of workflows.
26
17
27
18
### Demo and examples
28
19
@@ -33,11 +24,13 @@ Check out the following demos.
33
24
-[ChatOps Demo in Pull Requests](https://github.com/peter-evans/slash-command-dispatch/pull/8)
See [examples](examples.md) for command patterns and example workflows.
27
+
See [examples](docs/examples.md) for command patterns and example workflows.
37
28
38
29
## Dispatching commands
39
30
40
-
### Basic configuration
31
+
### Configuration
32
+
33
+
The following workflow should be configured in the repository where commands will be dispatched from. This example will respond to comments containing the slash commands `/rebase`, `/integration-test` and `/create-ticket`.
41
34
42
35
```yml
43
36
name: Slash Command Dispatch
@@ -55,24 +48,24 @@ jobs:
55
48
commands: rebase, integration-test, create-ticket
56
49
```
57
50
51
+
This action also features [advanced configuration](docs/advanced-configuration.md) that allows each command to be configured individually if necessary. Use the standard configuration shown above unless you require advanced features.
52
+
58
53
### Action inputs
59
54
60
-
For basic configuration, use the inputs in the leftmost column.
61
-
Use the JSON properties for [Advanced configuration](#advanced-configuration).
| `commands` | `command` | (**required**) Input: A comma separated list of commands to dispatch. JSON property: A single command. | |
69
-
| `permission` | `permission` | The repository permission level required by the user to dispatch commands. (`none`, `read`, `write`, `admin`) | `write` |
70
-
| `issue-type` | `issue_type` | The issue type required for commands. (`issue`, `pull-request`, `both`) | `both` |
| `repository` | The full name of the repository to send the dispatch events. | Current repository |
65
+
| `event-type-suffix` | The repository dispatch event type suffix for the commands. | `-command` |
66
+
| `named-args` | Parse named arguments and add them to the command payload. | `false` |
67
+
| `config` | | JSON configuration for commands. See [Advanced configuration](docs/advanced-configuration.md) | |
68
+
| `config-from-file` | | JSON configuration from a file for commands. See [Advanced configuration](docs/advanced-configuration.md) | |
76
69
77
70
### What is the reaction-token?
78
71
@@ -88,72 +81,6 @@ This means that reactions to comments will appear to be made by the user account
88
81
commands: rebase, integration-test, create-ticket
89
82
```
90
83
91
-
### Advanced configuration
92
-
93
-
Using JSON configuration allows the options for each command to be specified individually.
94
-
95
-
Note that it's recommended to write the JSON configuration directly in the workflow rather than use a file. Using the `config-from-file` input will be slightly slower due to requiring the repository to be checked out with `actions/checkout` so the file can be accessed.
96
-
97
-
Here is an example workflow. Take care to use the correct JSON property names.
The payload contains the complete `github` context of the `issue_comment` event at path `github.event.client_payload.github`.
191
150
Additionally, if the comment was made in a pull request, the action calls the [GitHub API to fetch the pull request detail](https://developer.github.com/v3/pulls/#get-a-single-pull-request) and attach it to the payload at path `github.event.client_payload.pull_request`.
0 commit comments