- Allow to configure multiple branches to release from - Allow to define a distribution channel associated with each branch - Manage the availability on distribution channels based on git merges - Support regular releases, maintenance releases and pre-releases - Add the `addChannel` plugin step to make an existing release available on a different distribution channel BREAKING CHANGE: the `branch` option has been removed in favor of `branches` The new `branches` option expect either an Array or a single branch definition. To migrate your configuration: - If you want to publish package from multiple branches, please the configuration documentation - If you use the default configuration and want to publish only from `master`: nothing to change - If you use the `branch` configuration and want to publish only from one branch: replace `branch` by `branches` (`"branch": "my-release-branch"` => `"branches": "my-release-branch"`)
24 lines
903 B
JavaScript
24 lines
903 B
JavaScript
const debug = require('debug')('semantic-release:get-commits');
|
|
const {getCommits} = require('./git');
|
|
|
|
/**
|
|
* Retrieve the list of commits on the current branch since the commit sha associated with the last release, or all the commits of the current branch if there is no last released version.
|
|
*
|
|
* @param {Object} context semantic-release context.
|
|
*
|
|
* @return {Promise<Array<Object>>} The list of commits on the branch `branch` since the last release.
|
|
*/
|
|
module.exports = async ({cwd, env, lastRelease: {gitHead: from}, nextRelease: {gitHead: to = 'HEAD'} = {}, logger}) => {
|
|
if (from) {
|
|
debug('Use from: %s', from);
|
|
} else {
|
|
logger.log('No previous release found, retrieving all commits');
|
|
}
|
|
|
|
const commits = await getCommits(from, to, {cwd, env});
|
|
|
|
logger.log(`Found ${commits.length} commits since last release`);
|
|
debug('Parsed commits: %o', commits);
|
|
return commits;
|
|
};
|