diff --git a/docs/automations/integrations/github-actions/dispatch-github-action/README.md b/docs/automations/integrations/github-actions/dispatch-github-action/README.md index 4771ce19c..f707532bb 100644 --- a/docs/automations/integrations/github-actions/dispatch-github-action/README.md +++ b/docs/automations/integrations/github-actions/dispatch-github-action/README.md @@ -73,6 +73,30 @@ Automatically trigger GitHub Actions based on PR content like changed resources, + +=== "Using Slash Commands" + Automatically dispatch gitHub actions workflow by using slash commands. + + !!! info "Configuration Description" + + **Conditions (all must be true):** + + * The PR has a comment that contains the text '/gitstream dispatch '. + + **Automation Actions:** + + * Dispatch the Github action workflow specified in the command. + +
+ !!! example "Dispatch GitHub Actions Using Slash Commands" + ```yaml+jinja + --8<-- "docs/downloads/automation-library/integrations/github-actions/dispatch-github-action/dispatch_github_action_slash_command.cm" + ``` +
+ + [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/github-actions/dispatch-github-action/dispatch_github_action_slash_command.cm){ .md-button } + +
## Additional Resources diff --git a/docs/automations/standard/review-assignment/assign-code-experts/README.md b/docs/automations/standard/review-assignment/assign-code-experts/README.md index 28c05a2b4..7065873aa 100644 --- a/docs/automations/standard/review-assignment/assign-code-experts/README.md +++ b/docs/automations/standard/review-assignment/assign-code-experts/README.md @@ -5,33 +5,60 @@ description: Automatically assign PR reviewers based on code expertise. # Assign Code Experts -When someone applies a `suggest-reviewers` label to a PR, use codeExperts to assign recommended reviewers and post a comment with the `explainCodeExperts` automation action. - -
-![Assign Code Experts](/automations/standard/review-assignment/assign-code-experts/assign_code_experts.png) -
-
-!!! info "Configuration Description" - Conditions (all must be true): - - * The PR has a suggest-reviewers label attached to it. - - Automation Actions: - - * Use `codeExperts` to assign recommended reviewers. - * Use `explainCodeExperts` to post a comment that lists the top code experts for the PR. -
-
-!!! example "Assign Code Experts" - ```yaml+jinja - --8<-- "docs/downloads/automation-library/standard/review-assignment/assign_code_experts.cm" - ``` -
- - [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/standard/review-assignment/assign_code_experts.cm){ .md-button } - +=== "Using Labels" + When someone applies a `suggest-reviewers` label to a PR, use codeExperts to assign recommended reviewers and post a comment with the `explainCodeExperts` automation action. + +
+ ![Assign Code Experts](/automations/standard/review-assignment/assign-code-experts/assign_code_experts.png) +
+
+ !!! info "Configuration Description" + Conditions (all must be true): + + * The PR has a suggest-reviewers label attached to it. + + Automation Actions: + + * Use `codeExperts` to assign recommended reviewers. + * Use `explainCodeExperts` to post a comment that lists the top code experts for the PR. +
+
+ !!! example "Assign Code Experts" + ```yaml+jinja + --8<-- "docs/downloads/automation-library/standard/review-assignment/assign_code_experts.cm" + ``` +
+ + [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/standard/review-assignment/assign_code_experts.cm){ .md-button } + +
-
+ +=== "Using Slash Commands" + Automatically Auto-assign code experts as reviewers using slash commands. + + ![Review Auto-assign Slash Command](/automations/standard/review-assignment/assign-code-experts/assign-code-experts-slash-command.png) + + !!! info "Configuration Description" + + **Conditions (all must be true):** + + * The PR has a comment that contains the text '/gitstream auto-assign'. + + **Automation Actions:** + + * Assign the top two code experts for the PR as reviewers. + +
+ !!! example "Auto-assign Reviewers Using a Slash Command" + ```yaml+jinja + --8<-- "docs/downloads/automation-library/standard/review-assignment/assign_expert_slash_command.cm" + ``` +
+ + [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/standard/review-assignment/assign_expert_slash_command.cm){ .md-button } + +
## Additional Resources @@ -39,7 +66,6 @@ When someone applies a `suggest-reviewers` label to a PR, use codeExperts to ass **Related Automations**: ---8<-- "docs/snippets/review-assignment-automation.md::1" ---8<-- "docs/snippets/review-assignment-automation.md:3:" +--8<-- "docs/snippets/general.md" --8<-- "docs/snippets/automation-footer.md" \ No newline at end of file diff --git a/docs/automations/standard/review-assignment/assign-code-experts/assign-code-experts-slash-command.png b/docs/automations/standard/review-assignment/assign-code-experts/assign-code-experts-slash-command.png new file mode 100644 index 000000000..2acf3a43a Binary files /dev/null and b/docs/automations/standard/review-assignment/assign-code-experts/assign-code-experts-slash-command.png differ diff --git a/docs/automations/standard/review-assignment/assign-expert-slash-command/README.md b/docs/automations/standard/review-assignment/assign-expert-slash-command/README.md new file mode 100644 index 000000000..320b79955 --- /dev/null +++ b/docs/automations/standard/review-assignment/assign-expert-slash-command/README.md @@ -0,0 +1,33 @@ +--- +title: gitStream Automation - Auto-assign Reviewers Using a Slash Command. +description: Automatically Auto-assign reviewers using a slash command. +--- +# Auto-assign Reviewers Using a Slash Command + + +Automatically Auto-assign reviewers using a slash command. + +![Review Auto-assign Slash Command](/automations/standard/slash-commands/review-auto-assign-slash-command/review-auto-assign-slash-command.png) + +!!! info "Configuration Description" + +**Conditions (all must be true):** + +* The PR has a comment that contains the term '/gitstream auto-assign'. + +**Automation Actions:** + +* Dispatch the Github action workflow mentioned in the term. + +
+!!! example "Auto-assign Reviewers Using a Slash Command" + ```yaml+jinja + --8<-- "docs/downloads/automation-library/standard/slash-commands/review-auto-assign-slash-command/review_auto_assign_slash_command.cm" + ``` +
+ + [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/standard/slash-commands/review-auto-assign-slash-command/review_auto_assign_slash_command.cm){ .md-button } + +
+ + diff --git a/docs/automations/standard/slash-commands/review-dispatch-github-action-slash-command/README.md b/docs/automations/standard/slash-commands/review-dispatch-github-action-slash-command/README.md new file mode 100644 index 000000000..cb7e3fa54 --- /dev/null +++ b/docs/automations/standard/slash-commands/review-dispatch-github-action-slash-command/README.md @@ -0,0 +1,33 @@ +--- +title: gitStream Automation - Dispatch GitHub Actions Based on a Slash Command +description: Automatically dispatch gitHub actions workflow based on a slash command. +--- +# Review Slash Commands and Dispatch GitHub Actions + + +Automatically dispatch gitHub actions workflow based on a slash command. + +![Review GitHub Actions Slash Command](/automations/standard/slash-commands/review-dispatch-github-action-slash-command/review-dispatch-github-action-slash-command.png) + +!!! info "Configuration Description" + +**Conditions (all must be true):** + +* The PR has a comment that contains the term '/gitstream dispatch '. + +**Automation Actions:** + +* Dispatch the Github action workflow mentioned in the term. + +
+!!! example "Review Slash Commands and Dispatch GitHub Actions" + ```yaml+jinja + --8<-- "docs/downloads/automation-library/standard/slash-commands/review-dispatch-github-action-slash-command/review_dispatch_github_action_slash_command.cm" + ``` +
+ + [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/standard/slash-commands/review-dispatch-github-action-slash-command/review_dispatch_github_action_slash_command.cm){ .md-button } + +
+ + diff --git a/docs/automations/standard/slash-commands/review-dispatch-github-action-slash-command/review-dispatch-github-action-slash-command.png b/docs/automations/standard/slash-commands/review-dispatch-github-action-slash-command/review-dispatch-github-action-slash-command.png new file mode 100644 index 000000000..81a72566b Binary files /dev/null and b/docs/automations/standard/slash-commands/review-dispatch-github-action-slash-command/review-dispatch-github-action-slash-command.png differ diff --git a/docs/downloads/automation-library/integrations/github-actions/dispatch-github-action/dispatch_github_action_slash_command.cm b/docs/downloads/automation-library/integrations/github-actions/dispatch-github-action/dispatch_github_action_slash_command.cm new file mode 100644 index 000000000..d7053c191 --- /dev/null +++ b/docs/downloads/automation-library/integrations/github-actions/dispatch-github-action/dispatch_github_action_slash_command.cm @@ -0,0 +1,41 @@ +# -*- mode: yaml -*- + +manifest: + version: 1.0 + +on: + - comment_added + +automations: + {% for item in pipelines %} + dispatch_github_action_{{ item.name }}: + if: + - {{ pr.comments | match(attr='content', term=item.command) | some }} + run: + - action: run-github-workflow@v1 + args: + workflow: .github/workflows/{{ item.workflow }} + check_name: {{ item.name }} + - action: add-label@v1 + args: + label: {{ item.name }} + {% endfor %} + +pipelines: + - name: mobile-ci + command: '/gitstream ci-mobile' + resources: + - 'src/android/' + - 'src/ios/' + workflow: mobile.yml + - name: backend-ci + command: '/gitstream ci-backend' + resources: + - 'src/api/' + - 'src/services' + workflow: 'backend.yml' + - name: frontend-ci + command: '/gitstream ci-frontend' + resources: + - 'src/app/' + workflow: 'frontend.yml' \ No newline at end of file diff --git a/docs/downloads/automation-library/standard/review-assignment/assign_expert_slash_command.cm b/docs/downloads/automation-library/standard/review-assignment/assign_expert_slash_command.cm new file mode 100644 index 000000000..b50c6d4b6 --- /dev/null +++ b/docs/downloads/automation-library/standard/review-assignment/assign_expert_slash_command.cm @@ -0,0 +1,21 @@ +# -*- mode: yaml -*- + +manifest: + version: 1.0 + +on: + - comment_added + +automations: + assign_expert_slash_command: + if: + - {{ is.requested }} + run: + - action: add-reviewers@v1 + args: + reviewers: {{ repo | codeExperts(gt=10) }} + - action: explain-code-experts@v1 + args: + gt: 10 +is: + requested: {{ pr.comments | match(attr='content', term='/gitstream auto-assign') | some }}