Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions docs/automations/integrations/cursor/flag-cursor-pr/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
title: Automation - Label Cursor PRs
description: Automatically apply labels to PRs that are assisted by Cursor
category: [quality, genai, cursor, quickstart]
---

# Automatically Label Cursor PRs
<!-- --8<-- [start:example]-->
Automatically apply labels to Pull Requests that are assisted by Cursor AI. This automation helps track the impact and usage of Cursor's AI capabilities across your development workflow. You can apply labels based on:

- A known list of Cursor users
- AI-generated code comments
- PR tags
- Inline prompt responses

=== "Label by Prompt"
Prompt PR authors to indicate if they used Cursor 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.

![Label Cursor by Prompt](/automations/integrations/cursor/flag-cursor-pr/label-cursor-by-prompt.png)

!!! info "Configuration Description"
Conditions:

* A PR is created

Automation Actions:

* Post a comment prompting the author to indicate if Cursor assisted the author with writing the code in the PR.

!!! example "Ask the PR author about Cursor usage."
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/cursor/comment_cursor_prompt.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/cursor/comment_cursor_prompt.cm){ .md-button }
</span>
</div>

!!! info "Configuration Description"
Conditions:

* A PR is updated or merged where the author indicates they used Cursor via a prompt.

Automation Actions:

* Apply a `🤖 Cursor` label to the PR

!!! example "Label PRs where the user indicated Cursor usage"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/cursor/label_cursor_by_prompt.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/cursor/label_cursor_by_prompt.cm){ .md-button }
</span>
</div>

=== "Label by Known Users"
Automatically apply labels to PRs that are created by known users of generative AI coding tools.

![Label by Contributors](/automations/integrations/cursor/flag-cursor-pr/label-cursor-by-contributors.png)
!!! info "Configuration Description"
Conditions:

* The PR author is one of a specified list of contributors

Automation Actions:

* Apply a `🤖 Cursor` label to the PR

!!! example "Label by Contributors"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/cursor/label_cursor_by_contributors.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/cursor/label_cursor_by_contributors.cm){ .md-button }
</span>
</div>

=== "Label by Tag"
Look for a specific tag in the PR title, description, comments or commit messages and if found add a label to the PR

![Label Cursor by Tag](/automations/integrations/cursor/flag-cursor-pr/label-cursor-by-tag.png)
!!! info "Configuration Description"
Conditions:

* The `#cursor#` tag is found in any of the PR title, description, comments or commit messages for commits in the PR

Automation Actions:

* Apply a `🤖 Cursor` label to the PR

!!! example "Label Cursor by Tag"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/cursor/label_cursor_by_tag.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/cursor/label_cursor_by_tag.cm){ .md-button }
</span>
</div>
<!-- --8<-- [end:example]-->
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-*- mode: yaml -*-

manifest:
version: 1.0

on:
- pr_created

automations:
comment_cursor_prompt:
# Post a comment for all PRs to prompt the PR author to indicate whether they used Cursor to assist coding in this PR
if:
- true
run:
- action: add-comment@v1
args:
comment: |
Please mark whether you used Cursor to assist coding in this PR

- [ ] Cursor Assisted
- [ ] Not Cursor Assisted
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- mode: yaml -*-

manifest:
version: 1.0

automations:
label_cursor_contributors:
# For all PRs authored by someone who is specified in the cursor_contributors list
if:
- {{ pr.author | match(list=cursor_contributors) | some }}
# Apply a label indicating the user has adopted Cursor
run:
- action: add-label@v1
args:
label: '🤖 Cursor'

cursor_contributors:
- username1
- username2
- etc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-*- mode: yaml -*-

manifest:
version: 1.0

automations:
# You should use this automation in conjunction with comment_cursor_prompt.cm
label_cursor_pr:
# If the PR author has indicated that they used Cursor to assist coding in this PR,
# apply a label indicating the PR was supported by Cursor
if:
- {{ pr.comments | filter(attr='commenter', term='gitstream-cm') | filter (attr='content', regex=r/\- \[x\] Cursor Assisted/) | some}}
run:
- action: add-label@v1
args:
label: '🤖 Cursor'
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# -*- mode: yaml -*-

manifest:
version: 1.0

on:
- comment_added
- commit
- pr_created

automations:
label_cursor:
# Detect PRs that contain the text '#cursor#' in the title, description, comments, or commit messages
if:
- {{ cursor_tag.pr_title or cursor_tag.pr_desc or cursor_tag.pr_comments or cursor_tag.commit_messages }}
# Apply a label indicating the user has adopted Cursor
run:
- action: add-label@v1
args:
label: '🤖 Cursor'

cursor_tag:
pr_title: {{ pr.title | includes(regex=r/#cursor#/) }}
pr_desc: {{pr.description | includes(regex=r/#cursor#/) }}
pr_comments: {{ pr.comments | map(attr='content') | match(regex=r/#cursor#/) | some }}
commit_messages: {{ branch.commits.messages | match(regex=r/#cursor#/) | some }}
26 changes: 21 additions & 5 deletions docs/integrations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,37 @@ visible: false

<div class="integrations-card" markdown="1">
<div class="integrations-card-title" markdown="1">
[:octicons-copilot-16: GitHub Copilot](/integrations/github-copilot)
[:material-label: PR Labels](/automations/standard/label-management)
</div>
</div>

<div class="integrations-card" markdown="1">
<div class="integrations-card-title" markdown="1">
[:material-label: PR Labels](/automations/standard/label-management)
[:material-git: Branch Management](/automations/standard/branch-management)
</div>
</div>

<div class="integrations-card" markdown="1">
<div class="integrations-card-title" markdown="1">
[:material-git: Branch Management](/automations/standard/branch-management)
[:simple-codereview: PR Reviews](/automations/standard/review-assignment)
</div>
</div>

</div>

## AI Tools

<div class="integrations-list" markdown="1">

<div class="integrations-card" markdown="1">
<div class="integrations-card-title" markdown="1">
[:simple-codereview: PR Reviews](/automations/standard/review-assignment)
[:octicons-copilot-16: GitHub Copilot](/integrations/github-copilot)
</div>
</div>

<div class="integrations-card" markdown="1">
<div class="integrations-card-title" markdown="1">
[:material-cube-outline: Cursor](/integrations/cursor)
</div>
</div>

Expand Down Expand Up @@ -164,6 +176,7 @@ visible: false
</div>

## Feature Flags

<div class="integrations-list" markdown="1">

<div class="integrations-card" markdown="1">
Expand Down Expand Up @@ -198,8 +211,8 @@ visible: false

</div>


## Languages

<div class="integrations-list" markdown="1">

<div class="integrations-card" markdown="1">
Expand Down Expand Up @@ -301,4 +314,7 @@ visible: false
<!-- --8<-- [end:integrations]-->

## Additional Resources

--8<-- "docs/snippets/general.md"

--8<-- "docs/snippets/general.md"
15 changes: 15 additions & 0 deletions docs/integrations/cursor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: Integrate gitStream with Cursor
description: Workflow automations to improve your Cursor AI usage.
---
# Integrate gitStream with Cursor

## Automatically Label Cursor-Assisted PRs

--8<-- "docs/automations/integrations/cursor/flag-cursor-pr/README.md:example"

## Additional Resources

--8<-- "docs/snippets/general.md"

--8<-- "docs/snippets/automation-footer.md"