- introduce minimalistic CONTRIBUTORS output for changelogs

- This is based only on PR authors at this time
  - RELATES TO https://github.com/mikepenz/release-changelog-builder-action/pull/1338
  - Thanks @Freezor
This commit is contained in:
Mike Penz
2024-06-20 11:46:23 +02:00
parent 67e423e289
commit 28b9afa1d6
5 changed files with 46 additions and 25 deletions
+10
View File
@@ -275,12 +275,22 @@ export function buildChangelog(diffInfo: DiffInfo, origPrs: PullRequestInfo[], o
}
core.info(`✒️ Wrote ${ignoredPrs.length} ignored pull requests down`)
// collect all contributors
let contributors: string[] = []
for (const pr of prs) {
contributors = contributors.concat(pr.author)
}
const contributorsString = contributors.join(', ')
core.setOutput('contributors', JSON.stringify(contributors))
// fill template
const placeholderMap = new Map<string, string>()
placeholderMap.set('CHANGELOG', changelog)
placeholderMap.set('UNCATEGORIZED', changelogUncategorized)
placeholderMap.set('OPEN', changelogOpen)
placeholderMap.set('IGNORED', changelogIgnored)
// fill special collected contributors
placeholderMap.set('CONTRIBUTORS', contributorsString)
// fill other placeholders
placeholderMap.set('CATEGORIZED_COUNT', categorizedPrs.length.toString())
placeholderMap.set('UNCATEGORIZED_COUNT', uncategorizedPrs.length.toString())