ci: reworks changelog and release notes generation (#6164)

This commit is contained in:
Elliot DeNolf
2024-04-30 23:50:49 -04:00
committed by GitHub
parent 5a82f34801
commit 17bee6a145
7 changed files with 551 additions and 778 deletions

View File

@@ -0,0 +1,20 @@
import type { ChangelogConfig } from 'changelogen'
import { determineSemverChange, getGitDiff, loadChangelogConfig, parseCommits } from 'changelogen'
import { getLatestCommits } from './getLatestCommits.js'
export async function getRecommendedBump(
fromVersion: string,
toVersion: string,
config?: ChangelogConfig,
) {
if (!config) {
config = await loadChangelogConfig(process.cwd(), {
repo: 'payloadcms/payload',
})
}
const commits = await getLatestCommits(fromVersion, toVersion, config)
const bumpType = determineSemverChange(commits, config)
return bumpType === 'major' ? 'minor' : bumpType
}