Skip to content

Commit 7dd5498

Browse files
JamesHenryFrozenPandaz
authored andcommitted
feat(release): allow disabling GitHub username matching in default changelog renderer (#26672)
(cherry picked from commit 3a2e8d4)
1 parent b215511 commit 7dd5498

File tree

4 files changed

+69
-2
lines changed

4 files changed

+69
-2
lines changed

docs/shared/recipes/nx-release/configure-changelog-format.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The default changelog renderer for `nx release` generates a changelog entry for
1818

1919
## Include All Metadata
2020

21-
There are a few options available to modify the default changelog renderer output. They can be applied to both `workspaceChangelog` and `projectChangelogs` in exactly the same way. All three options are true by default:
21+
There are a few options available to modify the default changelog renderer output. They can be applied to both `workspaceChangelog` and `projectChangelogs` in exactly the same way. All four options are true by default:
2222

2323
```json
2424
{
@@ -27,6 +27,7 @@ There are a few options available to modify the default changelog renderer outpu
2727
"projectChangelogs": {
2828
"renderOptions": {
2929
"authors": true,
30+
"mapAuthorsToGitHubUsernames": true,
3031
"commitReferences": true,
3132
"versionTitleDate": true
3233
}
@@ -40,6 +41,12 @@ There are a few options available to modify the default changelog renderer outpu
4041

4142
Whether the commit authors should be added to the bottom of the changelog in a "Thank You" section. Defaults to `true`.
4243

44+
#### `mapAuthorsToGitHubUsernames`
45+
46+
If authors is enabled, controls whether or not to try to map the authors to their GitHub usernames using https://ungh.cc (from https://github.com/unjs/ungh) and the email addresses found in the commits. Defaults to `true`.
47+
48+
You should disable this option if you don't want to make any external requests to https://ungh.cc
49+
4350
#### `commitReferences`
4451

4552
Whether the commit references (such as commit and/or PR links) should be included in the changelog. Defaults to `true`.
@@ -59,6 +66,7 @@ If you prefer a more minimalist changelog, you can set all the options to false,
5966
"projectChangelogs": {
6067
"renderOptions": {
6168
"authors": false,
69+
"mapAuthorsToGitHubUsernames": false,
6270
"commitReferences": false,
6371
"versionTitleDate": false
6472
}

packages/nx/release/changelog-renderer/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ export interface DefaultChangelogRenderOptions extends ChangelogRenderOptions {
6666
* section. Defaults to true.
6767
*/
6868
authors?: boolean;
69+
/**
70+
* If authors is enabled, controls whether or not to try to map the authors to their GitHub usernames
71+
* using https://ungh.cc (from https://github.com/unjs/ungh) and the email addresses found in the commits.
72+
* Defaults to true.
73+
*/
74+
mapAuthorsToGitHubUsernames?: boolean;
6975
/**
7076
* Whether or not the commit references (such as commit and/or PR links) should be included in the changelog.
7177
* Defaults to true.
@@ -290,7 +296,7 @@ const defaultChangelogRenderer: ChangelogRenderer = async ({
290296
}
291297

292298
// Try to map authors to github usernames
293-
if (repoSlug) {
299+
if (repoSlug && changelogRenderOptions.mapAuthorsToGitHubUsernames) {
294300
await Promise.all(
295301
[..._authors.keys()].map(async (authorName) => {
296302
const meta = _authors.get(authorName);

0 commit comments

Comments
 (0)