Skip to content

Integrate gitStream with Cursor

Automatically Label Cursor-Assisted PRs

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

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

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.

Ask the PR author about Cursor usage.

-*- 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 

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

Label PRs where the user indicated Cursor usage

-*- 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' 

Automatically apply labels to PRs that are created by known users of generative AI coding tools.

Label by Contributors

Configuration Description

Conditions:

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

Automation Actions:

  • Apply a 🤖 Cursor label to the PR

Label by Contributors

# -*- 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 

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

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

Label Cursor by Tag

# -*- 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 }} 

Additional Resources

gitStream is a workflow automation tool that enables you to use YAML configuration files to optimize your code review process. Add context to PRs, find code experts for reviews, and automate the merge process to maximize developer productivity.

Learn More about how gitStream Works.

More Automations can be found on the Automation Library and Integrations pages.