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
+24-90Lines changed: 24 additions & 90 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,16 +13,16 @@ 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.
16
+
Dispatching commands to be processed elsewhere keeps the workflow queue moving quickly. It essentially enables parallel processing of workflows.
17
17
18
18
### Key features
19
19
20
-
- Easy configuration of "ChatOps" slash commands
21
20
- Enables separating the queue of `issue_comment` events from the queue of dispatched commands to keep it fast moving
22
21
- Users receive faster feedback that commands have been seen and are waiting to be processed
23
22
- 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
23
+
- Long running workloads can be separated to a repository workflow queue of their own
24
+
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.
26
26
27
27
### Demo and examples
28
28
@@ -37,7 +37,9 @@ See [examples](examples.md) for command patterns and example workflows.
37
37
38
38
## Dispatching commands
39
39
40
-
### Basic configuration
40
+
### Dispatch configuration
41
+
42
+
This workflow should be configured in the repository where commands will be dispatched from.
41
43
42
44
```yml
43
45
name: Slash Command Dispatch
@@ -57,23 +59,22 @@ jobs:
57
59
58
60
### Action inputs
59
61
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 |
72
+
| `event-type-suffix` | The repository dispatch event type suffix for the commands. | `-command` |
73
+
| `named-args` | Parse named arguments and add them to the command payload. | `false` |
74
+
| `config` | | JSON configuration for commands. See [Advanced configuration](docs/advanced-configuration.md) | |
75
+
| `config-from-file` | | JSON configuration from a file for commands. See [Advanced configuration](docs/advanced-configuration.md) | |
76
+
77
+
This action also features [advanced configuration](docs/advanced-configuration.md) that allows each command to be configured individually if necessary.
77
78
78
79
### What is the reaction-token?
79
80
@@ -89,73 +90,6 @@ This means that reactions to comments will appear to be made by the user account
89
90
commands: rebase, integration-test, create-ticket
90
91
```
91
92
92
-
### Advanced configuration
93
-
94
-
Using JSON configuration allows the options for each command to be specified individually.
95
-
96
-
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.
97
-
98
-
Here is an example workflow. Take care to use the correct JSON property names.
@@ -191,7 +125,7 @@ Each argument is also supplied in a numbered property, i.e. `arg1`, `arg2`, `arg
191
125
# etc.
192
126
```
193
127
194
-
If the `named-args` input (or `named_args` JSON property) is set to `true`, any arguments that are prefixed in the format `name=argument` will be parsed and added to the payload.
128
+
If the `named-args` input is set to `true`, any arguments that are prefixed in the format `name=argument` will be parsed and added to the payload.
195
129
196
130
For example, the slash command `/deploy branch=master env=prod some other args` will be set in the JSON payload as follows.
| | `repository` | The full name of the repository to send the dispatch events. | Current repository |
34
+
| | `event_type_suffix` | The repository dispatch event type suffix for the commands. | `-command` |
35
+
| | `named_args` | Parse named arguments and add them to the command payload. | `false` |
36
+
| `config` | | JSON configuration for commands. See [Advanced configuration](#advanced-configuration) | |
37
+
| `config-from-file` | | JSON configuration from a file for commands. See [Advanced configuration](#advanced-configuration) | |
38
+
39
+
## Dispatching commands
40
+
41
+
There are two ways to specify JSON configuration for command dispatch. Directly in the workflow via the `config` input, OR, specifing a JSON config file via the `config-from-file` input.
42
+
43
+
**Note**: It is 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.
44
+
45
+
Here is a reference example workflow. Take care to use the correct [JSON property names](#advanced-action-inputs).
0 commit comments