- attempt to fix esm tests

This commit is contained in:
Mike Penz
2024-12-14 12:25:29 +01:00
parent 30758be82d
commit fe815a18f2
7 changed files with 23 additions and 38 deletions
+3 -15
View File
@@ -315,14 +315,12 @@ function buildPrStringsAndFillCategoryEntries(
}
}
const prStrings: PrStrings = {
return {
categorizedList: categorizedPrs,
uncategorizedList: uncategorizedPrs,
openList: openPrs,
ignoredList: ignoredPrs
}
return prStrings
}
function buildChangelogStrings(flatCategories: Category[], prStrings: PrStrings): ChangelogStrings {
@@ -371,14 +369,12 @@ function buildChangelogStrings(flatCategories: Category[], prStrings: PrStrings)
}
}
const changelogStrings: ChangelogStrings = {
return {
categorized: changelogCategorized,
uncategorized: changelogUncategorized,
open: changelogOpen,
ignored: changelogIgnored
}
return changelogStrings
}
function buildReleaseNotesTemplateContext(
@@ -550,15 +546,7 @@ export function renderEmptyChangelogTemplate(template: string, options: ReleaseN
const releaseNotesTemplateContext = buildCoreReleaseNotesTemplateContext(options)
const renderedEmptyChangelogTemplate = renderTemplateAndFillPlaceholderContext(
template,
releaseNotesTemplateContext,
placeholders,
undefined,
options.configuration
)
return renderedEmptyChangelogTemplate
return renderTemplateAndFillPlaceholderContext(template, releaseNotesTemplateContext, placeholders, undefined, options.configuration)
}
function buildCoreReleaseNotesTemplateContext(options: ReleaseNotesOptions): TemplateContext {
+3 -3
View File
@@ -118,7 +118,7 @@ export function checkExportedData(exportCache: boolean, cacheInput: string | nul
}
export function resolveMode(mode: string | undefined, commitMode: boolean): 'PR' | 'COMMIT' | 'HYBRID' {
if (commitMode === true) {
if (commitMode) {
return 'COMMIT'
}
@@ -179,10 +179,10 @@ function readConfiguration(filename: string): Configuration | undefined {
export function parseConfiguration(config: string): Configuration | undefined {
try {
// for compatibility with the `yml` file we require to use `#{{}}` instead of `${{}}` - replace it here.
const configurationJSON: Configuration = JSON.parse(config.replace(/\${{/g, '#{{'))
return configurationJSON
return JSON.parse(config.replace(/\${{/g, '#{{'))
} catch (error) {
core.info(`⚠️ Configuration provided, but it couldn't be parsed. Fallback to Defaults.`)
core.debug(`Error parsing configuration: ${error}`)
return undefined
}
}