Skip to content

Commit 7431e22

Browse files
committedSep 4, 2023
ci: use changelogen utility to get current branch
1 parent d28189e commit 7431e22

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed
 

‎scripts/update-changelog.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import { execSync } from 'node:child_process'
22
import { $fetch } from 'ofetch'
33
import { inc } from 'semver'
4-
import { generateMarkDown, loadChangelogConfig } from 'changelogen'
4+
import { generateMarkDown, getCurrentGitBranch, loadChangelogConfig } from 'changelogen'
55
import { determineBumpType, getLatestCommits, loadWorkspace } from './_utils'
66

7-
const releaseBranch = process.env.GITHUB_REF_NAME || 'main'
8-
97
async function main () {
8+
const releaseBranch = await getCurrentGitBranch()
109
const workspace = await loadWorkspace(process.cwd())
11-
const config = await loadChangelogConfig(process.cwd(), {
12-
})
10+
const config = await loadChangelogConfig(process.cwd(), {})
1311

1412
const commits = await getLatestCommits().then(commits => commits.filter(
1513
c => config.types[c.type] && !(c.type === 'chore' && c.scope === 'deps' && !c.isBreaking)

0 commit comments

Comments
 (0)
Please sign in to comment.