Fix logic for ignoring tag version matching

This commit is contained in:
Paul Hatcherian 2021-01-23 00:45:20 -05:00
parent 9475102a4a
commit fccf69567f
3 changed files with 5 additions and 5 deletions

4
dist/index.js vendored
View file

@ -1248,8 +1248,8 @@ async function run() {
if (currentTag) { if (currentTag) {
let tagVersion = parseVersion(currentTag); let tagVersion = parseVersion(currentTag);
if (tagVersion[0] !== major && if (tagVersion[0] !== major ||
tagVersion[1] !== minor && tagVersion[1] !== minor ||
tagVersion[2] !== patch) { tagVersion[2] !== patch) {
[major, minor, patch] = tagVersion; [major, minor, patch] = tagVersion;
increment = 0; increment = 0;

View file

@ -227,8 +227,8 @@ async function run() {
if (currentTag) { if (currentTag) {
let tagVersion = parseVersion(currentTag); let tagVersion = parseVersion(currentTag);
if (tagVersion[0] !== major && if (tagVersion[0] !== major ||
tagVersion[1] !== minor && tagVersion[1] !== minor ||
tagVersion[2] !== patch) { tagVersion[2] !== patch) {
[major, minor, patch] = tagVersion; [major, minor, patch] = tagVersion;
increment = 0; increment = 0;

View file

@ -510,7 +510,7 @@ test('Increment not affected by matching tag', () => {
repo.makeCommit('Initial Commit'); // 0.0.1+0 repo.makeCommit('Initial Commit'); // 0.0.1+0
repo.makeCommit('Second Commit'); // 0.0.1+1 repo.makeCommit('Second Commit'); // 0.0.1+1
repo.exec('git tag 1.0.0'); repo.exec('git tag 0.0.1');
expect(repo.runAction()).toMatch('Version is 0.0.1+1'); expect(repo.runAction()).toMatch('Version is 0.0.1+1');
repo.clean(); repo.clean();