mirror of
https://github.com/PaulHatch/semantic-version.git
synced 2026-04-25 15:54:25 +00:00
Add support to bump the version on each commit (MINOR)
This commit is contained in:
parent
959e71ff1c
commit
1412b429b4
5 changed files with 85 additions and 1 deletions
19
dist/index.js
vendored
19
dist/index.js
vendored
|
|
@ -1026,6 +1026,7 @@ const eol = '\n';
|
|||
const tagPrefix = core.getInput('tag_prefix') || '';
|
||||
const namespace = core.getInput('namespace') || '';
|
||||
const shortTags = core.getInput('short_tags') === 'true';
|
||||
const bumpEachCommit = core.getInput('bump_each_commit') === 'true';
|
||||
|
||||
const cmd = async (command, ...args) => {
|
||||
let output = '', errors = '';
|
||||
|
|
@ -1199,6 +1200,24 @@ async function run() {
|
|||
.split(eol)
|
||||
.reverse();
|
||||
|
||||
if (bumpEachCommit) {
|
||||
core.info(history)
|
||||
history.forEach(line => {
|
||||
if (line.includes(majorPattern)) {
|
||||
major += 1;
|
||||
minor = 0;
|
||||
patch = 0;
|
||||
} else if (line.includes(minorPattern)) {
|
||||
minor += 1;
|
||||
patch = 0;
|
||||
} else {
|
||||
patch += 1;
|
||||
}
|
||||
});
|
||||
setOutput(major, minor, patch, increment, changed, branch, namespace);
|
||||
return;
|
||||
}
|
||||
|
||||
// Discover the change time from the history log by finding the oldest log
|
||||
// that could set the version.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue