@hsorby/changelog
v3.0.2
Published
Generate a changelog for pull requests referencing issues in a repo workflow.
Readme
@hsorby/changelog
A streamlined changelog generator that maps GitHub Issue Types to categorized release notes. Unlike standard generators that rely on PR labels, this tool looks at the issues linked to your Pull Requests to determine where changes belong.
Usage
# Run via npx
npx @hsorby/changelog --from v1.0.0
# Or via yarn
yarn lerna-changelog --from v1.0.0
How it works
- Finds Commits: Identifies all commits between your specified tags on the target ref, default main.
- Links PRs: Maps those commits back to their parent Pull Requests.
- Inspects Issues: Looks at the Issues linked to those PRs.
- Categorizes: Matches the
issueTypeof the linked issue against your configuration to place the change in the correct section (e.g., Bug Fix, Feature).
Configuration
Add a changelog key to your package.json. Even though the key is still called labels, it now maps to the Type field found in your GitHub Issues (this should change in the future).
{
"changelog": {
"repo": "hsorby/my-project",
"labels": {
"feature": "🚀 New Features",
"bug": "🐛 Bug Fixes",
"documentation": "📝 Documentation",
"internal": "🏠 Internal Task"
},
"ignoreCommitters": [
"dependabot",
"github-actions"
]
}
}
The repo key is optional, the package will try and determine the repository from the repo key in the package.json itself.
Options
| Option | Description |
| --- | --- |
| repo | Your org/repo (Inferred from package.json if omitted). |
| nextVersion | The header for the latest changes (e.g., Latest Changes). |
| labels | Maps Issue Types to Section Headers. |
| ignoreCommitters | Array of usernames to exclude from the contributor list. |
Enhanced Features
📸 Clean Contributor Grids
No more messy inline lists. This fork renders a clean, centered grid of contributors with high-resolution avatars:
| | | | --- | --- | | @hsorby | @octocat |
🌳 Branch Awareness
The generator uses a target reference to ensure that only commits belonging to your primary branch are included, preventing "noise" from unmerged or side-feature branches.
⚡ Smart Caching
Includes an internal caching layer to prevent redundant GitHub API calls when multiple commits belong to the same Pull Request.
GitHub Token
To avoid API rate limiting, export a personal access token:
export GITHUB_AUTH="your_token_here"
Requires public_repo scope for public repositories.
