Skip to content

Commit 6d8aaa1

Browse files
committed
chore: update version script
1 parent 362fb4f commit 6d8aaa1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scripts/bump-package-versions.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,25 +62,25 @@ repoTags.forEach((tag) => {
6262
// Assumption: current version is latest on npm (so no checking it)
6363
publicPkgList.forEach((pkgInfo) => {
6464
if (pkgInfo.tag) {
65-
// need to calculate next version
6665
const commitList = execSync(`git log ${pkgInfo.tag}..HEAD --oneline`, { encoding: 'utf-8' }).split('\n');
6766
const pkgScope = pkgInfo.name.replace('@opentelemetry/', '');
68-
const commitsForPackage = commitList.filter((c) => c.indexOf(`(${pkgScope})`) !== -1);
67+
const commitsForPackage = commitList
68+
// Get only the ones with the scope
69+
.filter((c) => c.indexOf(`(${pkgScope})`) !== -1);
6970

7071
if (commitsForPackage.length === 0) {
7172
return;
7273
}
7374
console.log(pkgInfo.tag)
7475
console.log(commitsForPackage)
75-
const [major, minor, patch] = pkgInfo.version.split('.').map(n => parseInt(n, 10));
76-
const isExperimental = major === 0;
76+
const isExperimental = pkgInfo.version.startsWith('0.');
7777
const bumpMinor = commitsForPackage.some((cmt) => {
7878
const pattern = isExperimental ? `(${pkgScope})!:` : `feat(${pkgScope}):`
7979
return cmt.includes(pattern);
8080
});
8181
const bumpMajor = !isExperimental && commitsForPackage.some((cmt) => cmt.includes(`(${pkgScope})!:`));
8282

83-
let command
83+
let command;
8484
if (bumpMajor) {
8585
command = 'npm version major';
8686
} else if (bumpMinor) {

0 commit comments

Comments
 (0)