|
| 1 | +--- |
| 2 | +title: Automation - Label Windsurf PRs |
| 3 | +description: Automatically apply labels to PRs that are assisted by Windsurf |
| 4 | +category: [quality, genai, windsurf, quickstart] |
| 5 | +starter_kits: [genai] |
| 6 | +--- |
| 7 | + |
| 8 | +# Automatically Label Windsurf PRs |
| 9 | +<!-- --8<-- [start:example]--> |
| 10 | +Automatically apply labels to PRs that are assisted by Windsurf. You can apply labels based on a known list of Windsurf users, PR tags, or by prompting the PR author to indicate if they used Windsurf. |
| 11 | + |
| 12 | +=== "Label by Prompt" |
| 13 | + Prompt PR authors to indicate if they used Windsurf for the PR and automatically label the PR if they did. This requires two separate automation files to handle posting the prompt and labeling accordingly. |
| 14 | + |
| 15 | +  |
| 16 | + |
| 17 | + !!! info "Configuration Description" |
| 18 | + Conditions: |
| 19 | + |
| 20 | + * A PR is created |
| 21 | + |
| 22 | + Automation Actions: |
| 23 | + |
| 24 | + * Post a comment prompting the author to indicate if Windsurf assisted the author with writing the code in the PR. |
| 25 | + |
| 26 | + !!! example "Ask the PR author about Windsurf usage" |
| 27 | + ```yaml+jinja |
| 28 | + --8<-- "docs/downloads/automation-library/integrations/windsurf/comment_windsurf_prompt.cm" |
| 29 | + ``` |
| 30 | + <div class="result" markdown> |
| 31 | + <span> |
| 32 | + [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/windsurf/comment_windsurf_prompt.cm){ .md-button } |
| 33 | + </span> |
| 34 | + </div> |
| 35 | + |
| 36 | + !!! info "Configuration Description" |
| 37 | + Conditions: |
| 38 | + |
| 39 | + * A PR is updated or merged where the author indicates they used Windsurf via a prompt. |
| 40 | + |
| 41 | + Automation Actions: |
| 42 | + |
| 43 | + * Apply a `🤖 Windsurf` label to the PR |
| 44 | + |
| 45 | + !!! example "Label PRs where the user indicated Windsurf usage" |
| 46 | + ```yaml+jinja |
| 47 | + --8<-- "docs/downloads/automation-library/integrations/windsurf/label_windsurf_by_prompt.cm" |
| 48 | + ``` |
| 49 | + <div class="result" markdown> |
| 50 | + <span> |
| 51 | + [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/windsurf/label_windsurf_by_prompt.cm){ .md-button } |
| 52 | + </span> |
| 53 | + </div> |
| 54 | + |
| 55 | +=== "Label by Known Users" |
| 56 | + Automatically apply labels to PRs that are created by known users of generative AI coding tools. |
| 57 | + |
| 58 | +  |
| 59 | + !!! info "Configuration Description" |
| 60 | + Conditions: |
| 61 | + |
| 62 | + * The PR author is one of a specified list of contributors |
| 63 | + |
| 64 | + Automation Actions: |
| 65 | + |
| 66 | + * Apply a `🤖 Windsurf` label to the PR |
| 67 | + |
| 68 | + !!! example "Label by Contributors" |
| 69 | + ```yaml+jinja |
| 70 | + --8<-- "docs/downloads/automation-library/integrations/windsurf/label_windsurf_by_contributors.cm" |
| 71 | + ``` |
| 72 | + <div class="result" markdown> |
| 73 | + <span> |
| 74 | + [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/windsurf/label_windsurf_by_contributors.cm){ .md-button } |
| 75 | + </span> |
| 76 | + </div> |
| 77 | + |
| 78 | +=== "Label by Tag" |
| 79 | + Look for a specific tag in the PR title, description, comments or commit messages and if found add a label to the PR |
| 80 | + |
| 81 | +  |
| 82 | + !!! info "Configuration Description" |
| 83 | + Conditions: |
| 84 | + |
| 85 | + * The `#windsurf#` tag is found in any of the PR title, description, comments or commit messages for commits in the PR |
| 86 | + |
| 87 | + Automation Actions: |
| 88 | + |
| 89 | + * Apply a `🤖 Windsurf` label to the PR |
| 90 | + |
| 91 | + !!! example "Label Windsurf by Tag" |
| 92 | + ```yaml+jinja |
| 93 | + --8<-- "docs/downloads/automation-library/integrations/windsurf/label_windsurf_by_tag.cm" |
| 94 | + ``` |
| 95 | + <div class="result" markdown> |
| 96 | + <span> |
| 97 | + [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/windsurf/label_windsurf_by_tag.cm){ .md-button } |
| 98 | + </span> |
| 99 | + </div> |
| 100 | +<!-- --8<-- [end:example]--> |
0 commit comments