Skip to content

Commit

Permalink
truncate has for shorter cnary versions
Browse files Browse the repository at this point in the history
  • Loading branch information
hipstersmoothie committed Nov 6, 2020
1 parent a962ba2 commit ec34caf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/__tests__/auto-canary-local.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ test("shipit should publish canary in locally when not on master", async () => {
await auto.loadConfig();

auto.git!.getLatestRelease = () => Promise.resolve("1.2.3");
auto.git!.getSha = () => Promise.resolve("abc");
auto.git!.getSha = () => Promise.resolve("abcdefghijklmnop");
jest.spyOn(auto.git!, "createComment").mockImplementation();
auto.release!.getCommitsInRelease = () => Promise.resolve([]);
auto.release!.getCommits = () => Promise.resolve([]);
Expand All @@ -50,7 +50,7 @@ test("shipit should publish canary in locally when not on master", async () => {
expect(canary).toHaveBeenCalledWith(
expect.objectContaining({
bump: SEMVER.patch,
canaryIdentifier: "canary.abc",
canaryIdentifier: "canary.abcdefg",
})
);
});
4 changes: 3 additions & 1 deletion packages/core/src/auto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,9 @@ export default class Auto {
}

if (!pr || !build) {
canaryIdentifier = `${canaryIdentifier}.${await this.git.getSha(true)}`;
canaryIdentifier = `${canaryIdentifier}.${(
await this.git.getSha(true)
).slice(0, 7)}`;
}

canaryIdentifier = `canary${canaryIdentifier}`;
Expand Down

0 comments on commit ec34caf

Please sign in to comment.