Cherry Bot is a GitHub App built with Probot that automatically labels your issues and pull requests using configurable rules and Large Language Models (LLMs).
- Rule-Based Labeling: Define rules in
.github/cherry-bot.yml
to automatically label issues/PRs based on title, body content, or changed files. - AI-Powered Suggestions: Leverages OpenAI (or compatible APIs) to analyze issue/PR content and suggest relevant labels from your defined list.
- Configurable Confidence: Set a confidence threshold for AI suggestions to control when AI labels are applied.
- Flexible Configuration: Define available labels, rules, and AI settings in a simple YAML file.
- Event Trigger: Cherry Bot listens for
issues
(opened, edited) andpull_request
(opened, edited, synchronize) events. - Configuration Load: It reads the
.github/cherry-bot.yml
file in the repository. - Rule Matching: It checks the issue/PR against the defined rules.
- AI Analysis (if configured): If an OpenAI API key is provided and rules allow, it sends the title and body to the LLM for label suggestions.
- Label Application: It applies labels based on matched rules and high-confidence AI suggestions.
- Install the GitHub App on your repository or organization.
- Grant the necessary permissions (Issues: Read & Write, Pull Requests: Read & Write, Contents: Read).
Create a .github/cherry-bot.yml
file in your repository (optional if only using AI features with default threshold):
# .github/cherry-bot.yml
# Label Definitions (Optional): If provided, can be used for reference or future features.
# The bot now dynamically fetches labels from your repository for AI analysis.
# labels:
# - name: bug
# description: "Something isn't working"
# color: "d73a4a"
# - name: feature
# description: "New feature or request"
# color: "0075ca"
# AI Settings (Optional): Configure AI-powered label suggestions.
# Requires OPENAI_API_KEY environment variable set for the bot.
# You might also need OPENAI_BASE_URL if using a proxy or compatible API.
ai:
threshold: 0.8 # Default: 0.8. AI suggestions below this confidence score won't be applied.
# Labeling Rules (Optional): Define conditions to automatically apply labels based on content.
# rules:
# - name: "Bug Report"
# match:
# title: ["bug", "fix", "issue", "error", "fail"]
# labels: ["bug", "triage"]
# ...
Note: The bot now automatically fetches the list of available labels directly from your GitHub repository when performing AI analysis. You no longer need to define the labels
section for the AI to work, although providing it might be useful for documentation or future features like rule validation or label creation.
See CONTRIBUTING.md.