PR Generation
On this page 29
Buddy creates beautifully formatted pull requests with comprehensive information about dependency updates.
PR Structure
Each PR includes:
- Title - Descriptive update summary
- Update Table - All packages being updated
- Release Notes - Changelogs and breaking changes
- Metadata - Confidence metrics, age, adoption
- Rebase Checkbox - Interactive update control
- Configuration Section - Schedule and merge info
PR Format by Ecosystem
npm Dependencies
Full table with confidence badges:
| Package | Change | Age | Adoption | Passing | Confidence |
|---------|--------|-----|----------|---------|------------|
| [typescript](https://www.typescriptlang.org/) | `5.8.2` -> `5.8.3` | ... | ... | ... | ... |
PHP/Composer Dependencies
| Package | Change | File | Status |
|---------|--------|------|--------|
| laravel/framework | 10.0.0 -> 10.16.0 | composer.json | Available |
Zig Dependencies
| Package | Change | Type | File |
|---------|--------|------|------|
| httpz | 0.5.0 -> 0.6.0 | minor | build.zig.zon |
GitHub Actions
| Action | Change | File | Status |
|--------|--------|------|--------|
| actions/checkout | v4 -> v4.2.2 | ci.yml | Available |
Customizing PR Titles
Configure the title format:
pullRequest: {
titleFormat: 'chore(deps): {title}'
}
Available Variables
| Variable | Description | Example |
|---|---|---|
{title} | Generated title | "update typescript to 5.8.3" |
{package} | Package name | "typescript" |
{from} | Current version | "5.8.2" |
{to} | New version | "5.8.3" |
{type} | Update type | "patch" |
Examples
// Conventional commits style
titleFormat: 'chore(deps): {title}'
// Result: "chore(deps): update typescript to 5.8.3"
// Simple style
titleFormat: 'Update {package} to {to}'
// Result: "Update typescript to 5.8.3"
// With type
titleFormat: '[{type}] {title}'
// Result: "[patch] update typescript to 5.8.3"
Customizing Commit Messages
pullRequest: {
commitMessageFormat: 'chore(deps): {message}'
}
Labels
Static Labels
Always applied to PRs:
pullRequest: {
labels: ['dependencies', 'automated']
}
Dynamic Labels
Buddy automatically adds contextual labels:
| Label | Condition |
|---|---|
major-update | Major version change |
minor-update | Minor version change |
patch-update | Patch version change |
security | Security vulnerability fix |
npm | npm package update |
github-actions | Workflow update |
Reviewers and Assignees
pullRequest: {
// Request reviews from these users
reviewers: ['lead-dev', 'security-team'],
// Assign PR to these users
assignees: ['maintainer']
}
Package Grouping
Group related packages into single PRs:
packages: {
groups: [
{
name: 'TypeScript Types',
patterns: ['@types/*'],
strategy: 'minor'
},
{
name: 'Testing',
patterns: ['vitest', '@vitest/*', 'happy-dom'],
strategy: 'patch'
}
]
}
Group PR Title
chore(deps): update TypeScript Types (@types/node, @types/react, @types/bun)
Auto-Merge
Automatically merge PRs that meet criteria:
pullRequest: {
autoMerge: {
enabled: true,
strategy: 'squash',
conditions: ['patch-only']
}
}
Merge Strategies
| Strategy | Description |
|---|---|
squash | Squash commits (clean history) |
merge | Create merge commit |
rebase | Rebase and merge (linear) |
Auto-Merge Conditions
| Condition | Description |
|---|---|
patch-only | Only patch updates |
minor-and-patch | Minor and patch updates |
all | All updates (use cautiously) |
Rebase Feature
Every PR includes a rebase checkbox:
---
- [ ] <!-- rebase-check -->If you want to update/retry this PR, check this box
---
How It Works
- Check the box in the PR description
buddy-check.ymlworkflow detects checked boxes- PR is automatically updated with latest versions
- Checkbox is unchecked after successful update
Manual Trigger
buddy update-check --verbose
Release Notes
Buddy includes detailed release notes:
### Release Notes
<details>
<summary>microsoft/TypeScript (typescript)</summary>
### [`v5.8.3`](https://github.com/microsoft/TypeScript/releases/tag/v5.8.3)
##### Bug Fixes
- Fix issue with module resolution
- Improve error messages
</details>
Breaking Change Detection
Breaking changes are highlighted:
### Breaking Changes
- TypeScript now requires Node.js 18+
- Deprecated API removed
Confidence Metrics
PRs include Merge Confidence data:
| Metric | Description |
|---|---|
| Age | How long the version has been available |
| Adoption | Percentage of users who upgraded |
| Passing | CI pass rate for this upgrade path |
| Confidence | Overall confidence score |
PR Configuration Section
Each PR includes configuration info:
### Configuration
Schedule: Branch creation - At any time, Automerge - At any time
Automerge: Disabled by config. Please merge manually.
Rebasing: Whenever PR is behind base branch.
Ignore: Close this PR to ignore this update.
Dry Run
Preview PRs without creating them:
buddy update --dry-run
Output shows:
- Packages to be updated
- PR titles that would be created
- Files that would be modified
Programmatic Usage
Create PRs programmatically:
import { Buddy, getConfig } from '@buddysh/buddy'
const config = await getConfig()
const buddy = new Buddy(config)
// Scan for updates
const scanResult = await buddy.scanForUpdates()
console.log(`Found ${scanResult.updates.length} updates`)
// Create PRs
if (scanResult.updates.length > 0) {
await buddy.createPullRequests(scanResult)
}
Next Steps
- Review Configuration options
- See Usage Examples for advanced patterns