Skip to content

Commit

Permalink
fix get all untagged commits for first release
Browse files Browse the repository at this point in the history
  • Loading branch information
anbraten committed Jul 23, 2023
1 parent 857ae68 commit 2036c34
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async function run() {
return;
}

const lastestTag = tags.latest || "0.1.0";
const lastestTag = tags.latest || "0.0.0";
if (tags.latest) {
console.log("# Lastest tag is:", c.green(lastestTag));
} else {
Expand All @@ -74,10 +74,14 @@ async function run() {
);
}

const unTaggedCommits = await git.log({
from: lastestTag,
to: releaseBranch,
});
const unTaggedCommits = await git.log(
lastestTag === "0.0.0"
? [releaseBranch] // use all commits of release branch if first release
: {
from: lastestTag,
to: releaseBranch,
}
);

if (unTaggedCommits.total === 0) {
console.log(c.yellow("# No untagged commits found, skipping."));
Expand Down

0 comments on commit 2036c34

Please sign in to comment.