- ensure contributors are not listed multiple times
- provide `EXTERNAL_CONTRIBUTORS` template, not including the lib owner
This commit is contained in:
+7
-4
@@ -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());
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+7
-4
@@ -276,12 +276,14 @@ export function buildChangelog(diffInfo: DiffInfo, origPrs: PullRequestInfo[], o
|
||||
core.info(`✒️ Wrote ${ignoredPrs.length} ignored pull requests down`)
|
||||
|
||||
// collect all contributors
|
||||
let contributors: string[] = []
|
||||
const contributorsSet: Set<String> = 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<string, string>()
|
||||
@@ -291,6 +293,7 @@ export function buildChangelog(diffInfo: DiffInfo, origPrs: PullRequestInfo[], o
|
||||
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())
|
||||
|
||||
Reference in New Issue
Block a user