Skip to content

Commit

Permalink
Merge pull request #2229 from intuit/next-with-onlyGraduateWithReleas…
Browse files Browse the repository at this point in the history
…eLabel

Get correct next version when using onlyGraduateWithReleaseLabel
  • Loading branch information
adierkens committed Jul 15, 2022
2 parents a15f77b + 72d7460 commit b99c0e2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
10 changes: 9 additions & 1 deletion plugins/version-file/src/index.ts
Expand Up @@ -160,15 +160,23 @@ export default class VersionFilePlugin implements IPlugin {

// Figure out next version
const lastRelease = await auto.git!.getLatestRelease();
const currentBranch = await getCurrentBranch();

const latestTagInBranch = await (currentBranch === auto.baseBranch
? auto.git?.getLatestTagInBranch()
: auto.git?.getLastTagNotInBaseBranch(prereleaseBranch));

const latestTag =
(await auto.git?.getLastTagNotInBaseBranch(prereleaseBranch)) ||
latestTagInBranch ||
(await getPreviousVersion(auto, this.versionFile));

const nextVersion = determineNextVersion(
lastRelease,
latestTag,
bump,
prereleaseBranch
);

const prefixedVersion = auto.prefixRelease(nextVersion);
preReleaseVersions.push(prefixedVersion);

Expand Down
26 changes: 15 additions & 11 deletions yarn.lock
Expand Up @@ -13,10 +13,10 @@
integrity sha512-K1kQv1BZVtMXQqdpNZt9Pgh85KwamsWX9gYyq1xG4cpyb+EacfMiNfumrju16piFXanCUrCR0P1DowPjV2qV/A==

"@auto-it/bot-list@link:packages/bot-list":
version "10.36.2"
version "10.37.1"

"@auto-it/core@link:packages/core":
version "10.36.2"
version "10.37.1"
dependencies:
"@auto-it/bot-list" "link:packages/bot-list"
"@endemolshinegroup/cosmiconfig-typescript-loader" "^3.0.2"
Expand Down Expand Up @@ -59,7 +59,7 @@
url-join "^4.0.0"

"@auto-it/npm@link:plugins/npm":
version "10.36.2"
version "10.37.1"
dependencies:
"@auto-it/core" "link:packages/core"
"@auto-it/package-json-utils" "link:packages/package-json-utils"
Expand All @@ -77,13 +77,13 @@
user-home "^2.0.0"

"@auto-it/package-json-utils@link:packages/package-json-utils":
version "10.36.2"
version "10.37.1"
dependencies:
parse-author "^2.0.0"
parse-github-url "1.0.2"

"@auto-it/released@link:plugins/released":
version "10.36.2"
version "10.37.1"
dependencies:
"@auto-it/bot-list" "link:packages/bot-list"
"@auto-it/core" "link:packages/core"
Expand All @@ -92,6 +92,15 @@
io-ts "^2.1.2"
tslib "2.1.0"

"@auto-it/version-file@link:plugins/version-file":
version "10.37.1"
dependencies:
"@auto-it/core" "link:packages/core"
fp-ts "^2.5.3"
io-ts "^2.1.2"
semver "^7.0.0"
tslib "1.10.0"

"@babel/code-frame@7.12.11":
version "7.12.11"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f"
Expand Down Expand Up @@ -11531,12 +11540,7 @@ path-key@^3.0.0, path-key@^3.1.0:
resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375"
integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==

path-parse@^1.0.5, path-parse@^1.0.6:
version "1.0.7"
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==

path-parse@^1.0.7:
path-parse@^1.0.5, path-parse@^1.0.6, path-parse@^1.0.7:
version "1.0.7"
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
Expand Down

0 comments on commit b99c0e2

Please sign in to comment.