- ensure contributors are not listed multiple times

- provide `EXTERNAL_CONTRIBUTORS` template, not including the lib owner
This commit is contained in:
Mike Penz
2024-06-23 08:39:37 +02:00
parent 8c644a1e35
commit 09758f3887
3 changed files with 15 additions and 9 deletions
Generated Vendored
+7 -4
View File
@@ -2787,12 +2787,14 @@ function buildChangelog(diffInfo, origPrs, options) {
}
core.info(`✒️ Wrote ${ignoredPrs.length} ignored pull requests down`);
// collect all contributors
let contributors = [];
const contributorsSet = new Set();
for (const pr of prs) {
contributors = contributors.concat(`@${pr.author}`);
contributorsSet.add(`@${pr.author}`);
}
const contributorsString = contributors.join(', ');
core.setOutput('contributors', JSON.stringify(contributors));
const contributorsArray = Array.from(contributorsSet);
const contributorsString = contributorsArray.join(', ');
const externalContributorString = contributorsArray.filter(value => value !== options.owner).join(', ');
core.setOutput('contributors', JSON.stringify(contributorsSet));
// fill template
const placeholderMap = new Map();
placeholderMap.set('CHANGELOG', changelog);
@@ -2801,6 +2803,7 @@ function buildChangelog(diffInfo, origPrs, options) {
placeholderMap.set('IGNORED', changelogIgnored);
// fill special collected contributors
placeholderMap.set('CONTRIBUTORS', contributorsString);
placeholderMap.set('EXTERNAL_CONTRIBUTORS', externalContributorString);
// fill other placeholders
placeholderMap.set('CATEGORIZED_COUNT', categorizedPrs.length.toString());
placeholderMap.set('UNCATEGORIZED_COUNT', uncategorizedPrs.length.toString());
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long