Merge pull request #21058 from backstage/camilaibs/changeset-ignore-maintainer-mentions
Ignore maintainer thanks on changelogs
This commit is contained in:
@@ -32,7 +32,23 @@ async function getDependencyReleaseLine(changesets, dependenciesUpdated) {
|
||||
return ['- Updated dependencies', ...updatedDependenciesList].join('\n');
|
||||
}
|
||||
|
||||
async function getReleaseLine(changeset, type, options) {
|
||||
const { ignoreUserThanks: users = [] } = options ?? {};
|
||||
const ignoredLinks = new Set(
|
||||
users.map(user => `[@${user}](https://github.com/${user})`),
|
||||
);
|
||||
const releaseLine = await defaultChangelogFunctions.getReleaseLine(
|
||||
changeset,
|
||||
type,
|
||||
options,
|
||||
);
|
||||
return releaseLine.replace(/Thanks\s(.*)!\s/g, (_, group) => {
|
||||
const links = group.split(', ').filter(link => !ignoredLinks.has(link));
|
||||
return links.length ? `Thanks ${links.join(', ')}! ` : '';
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getReleaseLine: defaultChangelogFunctions.getReleaseLine,
|
||||
getReleaseLine,
|
||||
getDependencyReleaseLine,
|
||||
};
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
{
|
||||
"$schema": "https://unpkg.com/@changesets/config@1.3.0/schema.json",
|
||||
"changelog": ["./backstage-changelog.js", { "repo": "backstage/backstage" }],
|
||||
"changelog": [
|
||||
"./backstage-changelog.js",
|
||||
{
|
||||
"repo": "backstage/backstage",
|
||||
"ignoreUserThanks": ["benjdlambert", "freben", "jhaals", "Rugvip"]
|
||||
}
|
||||
],
|
||||
"commit": false,
|
||||
"linked": [],
|
||||
"access": "public",
|
||||
|
||||
Reference in New Issue
Block a user