Skip to content

Commit

Permalink
Fix logic for ignoring tag version matching
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulHatch committed Jan 23, 2021
1 parent 9475102 commit fccf695
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1248,8 +1248,8 @@ async function run() {

if (currentTag) {
let tagVersion = parseVersion(currentTag);
if (tagVersion[0] !== major &&
tagVersion[1] !== minor &&
if (tagVersion[0] !== major ||
tagVersion[1] !== minor ||
tagVersion[2] !== patch) {
[major, minor, patch] = tagVersion;
increment = 0;
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ async function run() {

if (currentTag) {
let tagVersion = parseVersion(currentTag);
if (tagVersion[0] !== major &&
tagVersion[1] !== minor &&
if (tagVersion[0] !== major ||
tagVersion[1] !== minor ||
tagVersion[2] !== patch) {
[major, minor, patch] = tagVersion;
increment = 0;
Expand Down
2 changes: 1 addition & 1 deletion index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ test('Increment not affected by matching tag', () => {

repo.makeCommit('Initial Commit'); // 0.0.1+0
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');

repo.clean();
Expand Down

0 comments on commit fccf695

Please sign in to comment.