Skip to content

Commit 466cf0e

Browse files
committed
📝 feat: add documentation for Windsurf PR labeling automation
1 parent acfba03 commit 466cf0e

File tree

11 files changed

+204
-2
lines changed

11 files changed

+204
-2
lines changed
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
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+
![Label Windsurf by Prompt](/automations/integrations/windsurf/flag-windsurf-pr/label-windsurf-by-prompt.png)
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+
![Label by Contributors](/automations/integrations/windsurf/flag-windsurf-pr/label-windsurf-by-contributors.png)
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+
![Label Windsurf by Tag](/automations/integrations/windsurf/flag-windsurf-pr/label-windsurf-by-tag.png)
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]-->
25.7 KB
Loading
101 KB
Loading
81.8 KB
Loading
1.61 KB
Loading
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
-*- mode: yaml -*-
2+
3+
manifest:
4+
version: 1.0
5+
6+
on:
7+
- pr_created
8+
9+
automations:
10+
comment_windsurf_prompt:
11+
# Post a comment for all PRs to prompt the PR author to indicate whether they used Windsurf to assist coding in this PR
12+
if:
13+
- true
14+
run:
15+
- action: add-comment@v1
16+
args:
17+
comment: |
18+
Please mark whether you used Windsurf to assist coding in this PR
19+
20+
- [ ] Windsurf Assisted
21+
- [ ] Not Windsurf Assisted
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# -*- mode: yaml -*-
2+
3+
manifest:
4+
version: 1.0
5+
6+
automations:
7+
label_windsurf_contributors:
8+
# For all PRs authored by someone who is specified in the windsurf_contributors list
9+
if:
10+
- {{ pr.author | match(list=windsurf_contributors) | some }}
11+
# Apply a label indicating the user has adopted Windsurf
12+
run:
13+
- action: add-label@v1
14+
args:
15+
label: '🤖 Windsurf'
16+
17+
windsurf_contributors:
18+
- username1
19+
- username2
20+
- etc
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
-*- mode: yaml -*-
2+
3+
manifest:
4+
version: 1.0
5+
6+
automations:
7+
# You should use this automation in conjunction with comment_windsurf_prompt.cm
8+
label_windsurf_pr:
9+
# If the PR author has indicated that they used Windsurf to assist coding in this PR,
10+
# apply a label indicating the PR was supported by Windsurf
11+
if:
12+
- {{ pr.comments | filter(attr='commenter', term='gitstream-cm') | filter (attr='content', regex=r/\- \[x\] Windsurf Assisted/) | some}}
13+
run:
14+
- action: add-label@v1
15+
args:
16+
label: '🤖 Windsurf'
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# -*- mode: yaml -*-
2+
3+
manifest:
4+
version: 1.0
5+
6+
on:
7+
- comment_added
8+
- commit
9+
- pr_created
10+
11+
automations:
12+
label_windsurf:
13+
# Detect PRs that contain the text '#windsurf#' in the title, description, comments, or commit messages
14+
if:
15+
- {{ windsurf_tag.pr_title or windsurf_tag.pr_desc or windsurf_tag.pr_comments or windsurf_tag.commit_messages }}
16+
# Apply a label indicating the user has adopted Windsurf
17+
run:
18+
- action: add-label@v1
19+
args:
20+
label: '🤖 Windsurf'
21+
22+
windsurf_tag:
23+
pr_title: {{ pr.title | includes(regex=r/#windsurf#/) }}
24+
pr_desc: {{pr.description | includes(regex=r/#windsurf#/) }}
25+
pr_comments: {{ pr.comments | map(attr='content') | match(regex=r/#windsurf#/) | some }}
26+
commit_messages: {{ branch.commits.messages | match(regex=r/#windsurf#/) | some }}

docs/integrations/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ visible: false
7777
</div>
7878
</div>
7979

80+
<div class="integrations-card" markdown="1">
81+
<div class="integrations-card-title" markdown="1">
82+
[:material-sail-boat: Windsurf](/integrations/windsurf)
83+
</div>
84+
</div>
85+
8086
</div>
8187

8288
## Security & Compliance
@@ -316,5 +322,3 @@ visible: false
316322
## Additional Resources
317323

318324
--8<-- "docs/snippets/general.md"
319-
320-
--8<-- "docs/snippets/general.md"

0 commit comments

Comments
 (0)