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: docs/examples.md
+132-8Lines changed: 132 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,19 @@
1
1
# Examples
2
2
3
-
This document details command patterns and examples.
4
-
5
3
-[Use case: Execute command using a specific repository branch](#execute-command-using-a-specific-repository-branch)
4
+
-[pytest](#pytest)
6
5
-[Use case: Execute command to modify a pull request branch](#execute-command-to-modify-a-pull-request-branch)
7
6
8
7
## Use case: Execute command using a specific repository branch
9
8
10
-
This is pattern for a slash command where the first argument is the branch to checkout. If no argument is given it defaults to `master`. For example, the following command will cause the command workflow to checkout the `develop` branch of the repository where the command was dispatched from. After the branch has been checked out in the command workflow, scripts or actions may be executed against it.
9
+
This is pattern for a slash command where a named argument specifies the branch to checkout. If the named argument is missing it defaults to `master`. For example, the following command will cause the command workflow to checkout the `develop` branch of the repository where the command was dispatched from. After the branch has been checked out in the command workflow, scripts, tools or actions may be executed against it.
11
10
12
11
```
13
-
/do-something develop
12
+
/do-something branch=develop
14
13
```
15
14
15
+
In the dispatch configuration for this command pattern, `named-args` should be set to `true`.
16
+
16
17
In the following command workflow, `REPO_ACCESS_TOKEN` is a `repo` scoped [Personal Access Token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line).
## Use case: Execute command to modify a pull request branch
57
122
58
-
This is pattern for a slash command used in pull request comments. It checks out the pull request branch and allows further script and action steps to modify it.
123
+
This is pattern for a slash command used in pull request comments. It checks out the pull request branch and allows further scripts, tools and action steps to modify it.
59
124
60
125
```
61
126
/fix-pr
62
127
```
63
128
129
+
In the dispatch configuration for this command pattern, `issue-type` should be set to `pull-request`. This will prevent it from being dispatched from regular issue comments where it will fail.
130
+
64
131
In the following command workflow, `REPO_ACCESS_TOKEN` is a `repo` scoped [Personal Access Token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line).
0 commit comments