1 | const debug = require('debug')('semantic-release:get-commits');
|
2 | const {getCommits} = require('./git');
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | module.exports = async ({cwd, env, lastRelease: {gitHead: from}, nextRelease: {gitHead: to = 'HEAD'} = {}, logger}) => {
|
12 | if (from) {
|
13 | debug('Use from: %s', from);
|
14 | } else {
|
15 | logger.log('No previous release found, retrieving all commits');
|
16 | }
|
17 |
|
18 | const commits = await getCommits(from, to, {cwd, env});
|
19 |
|
20 | logger.log(`Found ${commits.length} commits since last release`);
|
21 | debug('Parsed commits: %o', commits);
|
22 | return commits;
|
23 | };
|