Skip to content

PR Description Using LinearB's AI

Use the describe-changes automation action to automatically generate and append a concise, AI-generated description to a pull request. This ensures that all PRs include meaningful and helpful descriptions, improving review efficiency.

summarized-pr

Configuration Description

Conditions (all must be true):

  • A PR is created or new code has been committed to the PR.

Automation Actions:

  • Append the AI-generated description to the PR description.

Configuration Example

manifest:
  version: 1.0

automations:
  linearb_ai_description:
    # Triggers only when PR is created or has new commits, see docs
    #   https://docs.gitstream.cm/execution-model/#action-level-execution-control
    # Skip description for Draft PRs and PRs from bots
    if:
      - {{ not pr.draft }}
      - {{ not (is.bot_author or is.bot_branch) }}
    run:
      - action: describe-changes@v1
        args:
          concat_mode: append


is:
  bot_author: {{ pr.author | match(list=['github-actions', '_bot_', '[bot]', 'dependabot']) | some }}
  bot_branch: {{ branch.name | match(list=['renovate/']) | some }}

Localization Support

You can request the AI to add PR descriptions in your preferred language by adding it to the guidelines:

automations:
  linearb_ai_desc:
    if:
      - {{ not pr.draft }}
    run:
      - action: describe-changes@v1
        args:
          concat_mode: append
          guidelines: |
            - Use Korean language for all comments

Repository rules file example

  1. Add the rules file to your repo root:

    ./DESCRIPTION_RULES.md
    -  Add emojis to highlight important changes.
    -  Use clear and concise language.
    -  Avoid using jargon or technical terms.
    
  2. Load the file in the PR descriptions automation:

    automations:
      linearb_ai_desc:
        if:
          - {{ not pr.draft }}
        run:
          - action: describe-changes@v1
            args:
              concat_mode: append
              guidelines: {{ "./DESCRIPTION_RULES.md" | readFile() | dump }}
    

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.

Related Automations:

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