Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: use Current branch instead of master for LTS comparison
  • Loading branch information
codebytere committed Mar 12, 2020
commit c0693d736594d11df4521019dd8729951f30b89d
16 changes: 12 additions & 4 deletions lib/prepare_release.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,15 +443,23 @@ class ReleasePreparation {
`backport-blocked-v${majorVersion}.x`
];

let comparisonBranch = 'master';
const isSemverMinor = versionComponents.patch === 0;
if (isLTS && !isSemverMinor) {
excludeLabels.push('semver-minor');
if (isLTS) {
// Assume Current branch matches tag with highest semver value.
const tags = runSync('git',
['tag', '-l', '--sort', '-version:refname']).trim();
const highestVersionTag = tags.split('\n')[0];
comparisonBranch = `v${semver.coerce(highestVersionTag).major}.x`;

if (!isSemverMinor) {
excludeLabels.push('semver-minor');
}
}

branchDiffOptions = [
stagingBranch,
// TODO(codebytere): use Current branch instead of master for LTS
'master',
comparisonBranch,
`--exclude-label=${excludeLabels.join(',')}`,
'--filter-release'
];
Expand Down