symplify/changelog-linker
Automatically links issue and pull request references in your changelog to GitHub (and similar) URLs. Cleans up release notes by turning #123, GH-123 or full references into clickable links, with configurable patterns and formatting for consistent, readable changelogs.
symplify/changelog-linker package is a read-only tool designed to enhance CHANGELOG.md by automatically linking version entries (e.g., ## 1.2.0) to their corresponding Git tags, commits, or pull requests. This is particularly valuable for:
CHANGELOG.md (via laravel/new or manual processes).changelog-linker) and a PHP library, requiring minimal Laravel-specific setup.post-release hook).### Breaking Changes).CHANGELOG.md strictly follow Keep a Changelog conventions? If not, how will edge cases (e.g., nested headers, custom syntax) be handled?git tag but before git push?)release:post events without wrapper code).Phase 1: Local Validation
composer require --dev symplify/changelog-linker
vendor/bin/changelog-linker link CHANGELOG.md
CHANGELOG.md (e.g., ## 1.2.0 → [1.2.0](https://github.com/.../tree/1.2.0)).Phase 2: CI/CD Integration
.github/workflows/release.yml:
- name: Link changelog
run: vendor/bin/changelog-linker link CHANGELOG.md
composer.json:
"scripts": {
"post-release": "changelog-linker link CHANGELOG.md"
}
Phase 3: Laravel Wrapper (Optional)
// app/Console/Commands/LinkChangelog.php
use Symplify\ChangelogLinker\ChangelogLinker;
class LinkChangelog extends Command {
protected $signature = 'changelog:link';
public function handle() {
(new ChangelogLinker())->link(file_get_contents('CHANGELOG.md'));
}
}
app/Console/Kernel.php:
protected $commands = [
Commands\LinkChangelog::class,
];
## X.Y.Z headers. Custom formats may require configuration (e.g., --version-header-pattern).### v1.2.0, adjust the pattern in the CLI or library..git directory. Works for monorepos if the changelog is in the root.--git-dir=/path/to/repo/.git).CHANGELOG.md manually or via script (e.g., laravel-release).git tag -a v1.2.0 -m "Release 1.2.0"
composer changelog:link # If using Laravel wrapper
git push origin v1.2.0
HEAD).CHANGELOG.md post-linking (breaks links).CHANGELOG.md directly after linking").--dry-run flag).--verbose flag or wrap in a Laravel command with logging.CONTRIBUTING.md section on changelog standards.## Changelog Workflow
1. Update CHANGELOG.md with new entries.
2. Run `php artisan changelog:link` to auto-generate links.
3. Tag the release: `git tag -a vX.Y.Z -m "..."`.
O(n)) where n = lines in CHANGELOG.md.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Changelog format breaks | Links point to wrong commits |
How can I help you explore Laravel packages today?