Skip to content

Commit c0693d7

Browse files
committed
fix: use Current branch instead of master for LTS comparison
1 parent 6cda82a commit c0693d7

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

lib/prepare_release.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -443,15 +443,23 @@ class ReleasePreparation {
443443
`backport-blocked-v${majorVersion}.x`
444444
];
445445

446+
let comparisonBranch = 'master';
446447
const isSemverMinor = versionComponents.patch === 0;
447-
if (isLTS && !isSemverMinor) {
448-
excludeLabels.push('semver-minor');
448+
if (isLTS) {
449+
// Assume Current branch matches tag with highest semver value.
450+
const tags = runSync('git',
451+
['tag', '-l', '--sort', '-version:refname']).trim();
452+
const highestVersionTag = tags.split('\n')[0];
453+
comparisonBranch = `v${semver.coerce(highestVersionTag).major}.x`;
454+
455+
if (!isSemverMinor) {
456+
excludeLabels.push('semver-minor');
457+
}
449458
}
450459

451460
branchDiffOptions = [
452461
stagingBranch,
453-
// TODO(codebytere): use Current branch instead of master for LTS
454-
'master',
462+
comparisonBranch,
455463
`--exclude-label=${excludeLabels.join(',')}`,
456464
'--filter-release'
457465
];

0 commit comments

Comments
 (0)