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
Commands are dispatched with a payload containing a number of contexts.
174
176
177
+
#### `slash_command` context
178
+
175
179
The slash command context can be accessed as follows.
176
180
`args`is a space separated string of all the supplied arguments.
177
181
Each argument is also supplied in a numbered property, i.e. `arg1`, `arg2`, `arg3`, etc.
@@ -187,6 +191,36 @@ Each argument is also supplied in a numbered property, i.e. `arg1`, `arg2`, `arg
187
191
# etc.
188
192
```
189
193
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.
195
+
196
+
For example, the slash command `/deploy branch=master env=prod some other args` will be set in the JSON payload as follows.
197
+
198
+
```json
199
+
{
200
+
"command": "deploy",
201
+
"args": "branch=master env=prod some other args",
202
+
"unnamed_args": "some other args",
203
+
"branch": "master",
204
+
"env": "prod",
205
+
"arg1": "some",
206
+
"arg2": "other",
207
+
"arg3": "args"
208
+
}
209
+
```
210
+
211
+
These named args can be accessed in a workflow as follows.
The payload contains the complete `github` context of the `issue_comment` event at path `github.event.client_payload.github`.
191
225
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