- add new configuration to enable exportCache (disabled by default)

- this changes behavior since `rc04`
This commit is contained in:
Mike Penz
2023-07-28 11:24:47 +00:00
committed by GitHub
parent 5c949cd54d
commit f0cbee5a3a
9 changed files with 62 additions and 33 deletions
+2
View File
@@ -55,6 +55,7 @@ async function run(): Promise<void> {
const fetchReleaseInformation = core.getInput('fetchReleaseInformation') === 'true'
const fetchReviews = core.getInput('fetchReviews') === 'true'
const commitMode = core.getInput('commitMode') === 'true'
const exportCache = core.getInput('exportCache') === 'true'
const exportOnly = core.getInput('exportOnly') === 'true'
const result = await new ReleaseNotesBuilder(
@@ -73,6 +74,7 @@ async function run(): Promise<void> {
fetchReleaseInformation,
fetchReviews,
commitMode,
exportCache,
exportOnly,
configuration
).build()
+14 -11
View File
@@ -45,6 +45,7 @@ export class ReleaseNotesBuilder {
private fetchReleaseInformation: boolean = false,
private fetchReviews: boolean = false,
private commitMode: boolean = false,
private exportCache: boolean = false,
private exportOnly: boolean = false,
private configuration: Configuration
) {}
@@ -107,18 +108,20 @@ export class ReleaseNotesBuilder {
const diffInfo = prData.diffInfo
this.setOutputs(options, diffInfo, mergedPullRequests)
const cache = {
mergedPullRequests,
diffInfo,
options
}
core.setOutput(`cache`, JSON.stringify(cache))
//fs.writeFileSync(path.resolve('cache.json'), JSON.stringify(cache))
if (this.exportCache) {
const cache = {
mergedPullRequests,
diffInfo,
options
}
core.setOutput(`cache`, JSON.stringify(cache))
//fs.writeFileSync(path.resolve('cache.json'), JSON.stringify(cache))
if (this.exportOnly) {
core.info(`️ Enabled 'exportOnly' will not generate changelog`)
core.endGroup()
return null
if (this.exportOnly) {
core.info(`️ Enabled 'exportOnly' will not generate changelog`)
core.endGroup()
return null
}
}
return buildChangelog(diffInfo, mergedPullRequests, options)
+1 -1
View File
@@ -251,7 +251,7 @@ export function buildChangelog(diffInfo: DiffInfo, origPrs: PullRequestInfo[], o
}
}
// note the `exclude label` configuration of categories will not apply to the legacy "UNCATEGORIZED" placeholder
// note the `exclude label` configuration of categories will not apply to the legacy "UNCATEGORIZED" placeholder
uncategorizedPrs.push(body)
} else {
categorizedPrs.push(body)