fix(dev-infra): use the version from package.json rather than tags (#42872)
Use the version value from the primary package.json file rather than checking the branch for the latest semver tag. This allows for us to explictly create changelogs from the previous version to the new version. PR Close #42872
This commit is contained in:
committed by
Alex Rickabaugh
parent
445fee4174
commit
282e86ad71
@@ -162,6 +162,19 @@ export class GitClient {
|
||||
return new SemVer(latestTag, semVerOptions);
|
||||
}
|
||||
|
||||
/** Retrieves the git tag matching the provided SemVer, if it exists. */
|
||||
getMatchingTagForSemver(semver: SemVer): string {
|
||||
const semVerOptions: SemVerOptions = {loose: true};
|
||||
const tags = this.runGraceful(['tag', '--sort=-committerdate', '--merged']).stdout.split('\n');
|
||||
const matchingTag =
|
||||
tags.find((tag: string) => parse(tag, semVerOptions)?.compare(semver) === 0);
|
||||
|
||||
if (matchingTag === undefined) {
|
||||
throw new Error(`Unable to find a tag for the version: "${semver.format()}"`);
|
||||
}
|
||||
return matchingTag;
|
||||
}
|
||||
|
||||
/** Retrieve a list of all files in the repository changed since the provided shaOrRef. */
|
||||
allChangesFilesSince(shaOrRef = 'HEAD'): string[] {
|
||||
return Array.from(new Set([
|
||||
|
||||
Reference in New Issue
Block a user