Generate PR based changelog or release-notes for multi-scope projects with templates
- uses: arpitBhalla/monorepo-changelog@master
with:
GITHUB_AUTH: "${{ secrets.GITHUB_TOKEN }}"
from: "1.2.0"
See example
You can configure by adding a changelog key to the package.json file of your project:
// ./package.json
{
// ...
"changelog": {
"labels": {
"PR: Breaking Change": "Breaking Change",
"PR: Feature": "Feature",
"PR: Bug": "Bug fix",
"PR: Maintenance": "Maintenance",
"PR: Docs": "Docs",
"PR: Refactoring": "Refactoring"
},
"scopes": {
"native-app": "Native App",
"website/docs": "Docs"
}
}
}
Action | Description | Default |
---|---|---|
GITHUB_AUTH (required) |
Personal Access Token with read permission | |
group-by |
labels |
|
from |
The current version of the project (SHA or Tag) | |
to |
The next version of the project (SHA or Tag) | |
template |
Handlebar template for Changelog | |
version_name |
Title for unreleased commits (e.g. Unreleased) | Unreleased |
repo |
Your org/repo on GitHub (automatically inferred from the package.json file) |
|
language |
Language of the changelog | Markdown |
Action | Description |
---|---|
changelog |
Generated changelog |
# .github/workflows/changelog.yml
name: "generate changelog"
on:
push:
branches:
- main
jobs:
changelog:
runs-on: ubuntu-latest
steps:
# To reference old commits, fetch-depth: 0 is required.
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: arpitBhalla/monorepo-changelog@master
id: generate
with:
GITHUB_AUTH: "${{ secrets.GITHUB_TOKEN }}"
from: "1.2.0"
to: "origin/main"
template: |
{{#each .}}
## {{releaseTitle}} (__{{releaseDate}}__)
{{#each labels}}
### {{ name }}
{{#each scopes }}
#### \`{{name}}\`
{{#each changes}}
- [#{{id}}]({{html_url}}) {{title}} by @{{author}}
{{/each}}
{{/each}}
---
{{/each}}
Thanks to {{contributorCount}} contributors namely {{#each contributors}}[@{{login}}]({{url}}){{#unless @last}},{{/unless}} {{/each}}
{{/each }}
- run: echo "${{steps.generate.outputs.changelog}}"
## Unreleased (2021-05-27)
### Feature
#### \`Native App\`
- [#18](https://github.com/{{owner}}/{{repo}}/pull/18) chore(yarn): add lerna-changelog ([@{{owner}}](https://github.com/{{owner}}))
### Maintenance
#### \`Native App\`
- [#1](https://github.com/{{owner}}/{{repo}}/pull/1) Bump @types/node from 14.14.9 to 15.3.0 ([@dependabot[bot]](https://github.com/apps/dependabot))
- [#2](https://github.com/{{owner}}/{{repo}}/pull/2) Bump @actions/core from 1.2.6 to 1.2.7 ([@dependabot[bot]](https://github.com/apps/dependabot))
#### \`Docs\`
- [#3](https://github.com/{{owner}}/{{repo}}/pull/3) Bump eslint-plugin-jest from 24.1.3 to 24.3.6 ([@dependabot[bot]](https://github.com/apps/dependabot))
Thanks to 1 contributors namely [@arpitBhalla](https://github.com/arpitBhalla)
Key | Description |
---|---|
labels |
Map of label to scope |
scopes |
Map of scope to label |
See Ouput