A Robo task for generating comprehensive release notes from GitHub PRs and issues.
- Automatic PR Detection: Extracts pull request numbers from git commit messages using multiple merge strategies
- GitHub API Integration: Fetches detailed information about PRs and their associated issues
- Smart Grouping: Groups pull requests by their related issues for better organization
- Contributor Tracking: Automatically tracks contributors from both PR authors and issue reporters
- Code Statistics: Provides statistics on lines changed and files modified
- Flexible Tag Comparison: Compare from any tag or automatically use the latest tag
- Rate Limiting: Respects GitHub API rate limits with intelligent batching
Install via Composer:
composer require gizra/robo-release-notes
- Include the trait in your RoboFile.php:
<?php
use Gizra\RoboReleaseNotes\ReleaseNotesTasks;
class RoboFile extends \Robo\Tasks
{
use ReleaseNotesTasks;
}
- Set up environment variables:
export GITHUB_ACCESS_TOKEN="your_github_token"
export GITHUB_USERNAME="your_github_username"
Generate release notes from the latest tag:
robo generate:release-notes
Generate release notes from a specific tag:
robo generate:release-notes v1.2.0
Variable | Description | Required |
---|---|---|
GITHUB_ACCESS_TOKEN |
GitHub personal access token with repo access | Yes |
GITHUB_USERNAME |
Your GitHub username | Yes |
To create a GitHub personal access token:
- Go to GitHub Settings → Developer settings → Personal access tokens
- Generate a new token with
repo
scope - Copy the token and set it as an environment variable
## Changelog
- Implement user authentication system (#123)
- Add login functionality (#145)
- Add password reset feature (#146)
- Implement session management (#147)
- Fix payment processing bugs (#124)
- Resolve credit card validation issues (#148)
### Other Changes
- Update documentation (#149)
- Refactor utility functions (#150)
## Contributors
- @alice (5)
- @bob (3)
- @charlie (2)
## Code Statistics
- Lines added: 1,234
- Lines deleted: 567
- Files changed: 23
- Git Analysis: Scans git commits between the specified tag and HEAD
- PR Extraction: Uses regex patterns to extract PR numbers from commit messages
- GitHub API Calls: Fetches detailed PR and issue data from GitHub
- Issue Linking: Automatically links PRs to their associated issues using:
- Closing keywords (fixes, closes, resolves)
- Issue references in PR titles and descriptions
- Issue numbers in branch names
- Data Aggregation: Combines all data into a structured release notes format
Run the test suite:
composer test
Run code style checks:
composer cs
Fix code style issues:
composer cbf
- PHP 7.4 or higher
- Robo 3.0 or 4.0
- cURL extension
- JSON extension
- Git repository with GitHub remote
- GitHub API access
For GitHub Enterprise users, you can extend the ReleaseNotesGenerator
class and override the githubApiGet
method to use a custom API endpoint.
You can extend the ReleaseNotesGenerator
class and override the displayReleaseNotes
method to customize the output format.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
See CHANGELOG.md for a complete list of changes.