Skip to content

Commit

Permalink
Feature (release-tools): Allow defining a main branch when generating…
Browse files Browse the repository at this point in the history
… the changelog entries.
  • Loading branch information
pomek committed Sep 23, 2024
1 parent 2358a19 commit 8b5078e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ const noteInfo = `[ℹ️](${ VERSIONING_POLICY_URL }#major-and-minor-breaking-c
*
* @param {String} [options.releaseBranch='master'] A name of the branch that should be used for releasing packages.
*
* @param {String} [options.mainBranch='master'] A name of the main branch in the repository.
*
* @param {Array.<ExternalRepository>} [options.externalRepositories=[]] An array of object with additional repositories
* that the function takes into consideration while gathering commits. It assumes that those directories are also mono repositories.
*
Expand Down Expand Up @@ -85,6 +87,7 @@ export default async function generateChangelogForMonoRepository( options ) {
cwd: options.cwd,
from: options.from ? options.from : 'v' + rootPkgJson.version,
releaseBranch: options.releaseBranch || 'master',
mainBranch: options.mainBranch || 'master',
externalRepositories: options.externalRepositories || []
};

Expand Down Expand Up @@ -225,7 +228,8 @@ export default async function generateChangelogForMonoRepository( options ) {

const commitOptions = {
from: options.from,
releaseBranch: options.releaseBranch
releaseBranch: options.releaseBranch,
mainBranch: options.mainBranch
};

let promise = getCommits( transformCommit, commitOptions )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ const SKIP_GENERATE_CHANGELOG = 'Typed "skip" as a new version. Aborting.';
*
* @param {String} [options.releaseBranch='master'] A name of the branch that should be used for releasing packages.
*
* @param {String} [options.mainBranch='master'] A name of the main branch in the repository.
*
* @param {FormatDateCallback} [options.formatDate] A callback allowing defining a custom format of the date inserted into the changelog.
* If not specified, the default date matches the `YYYY-MM-DD` pattern.
*
Expand All @@ -53,7 +55,8 @@ export default async function generateChangelogForSinglePackage( options = {} )

const commitOptions = {
from: options.from ? options.from : 'v' + pkgJson.version,
releaseBranch: options.releaseBranch
releaseBranch: options.releaseBranch || 'master',
mainBranch: options.mainBranch || 'master'
};

// Initial release.
Expand Down

0 comments on commit 8b5078e

Please sign in to comment.