We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6f694fe + c214a53 commit 666e239Copy full SHA for 666e239
packages/core/src/auto.ts
@@ -1310,9 +1310,14 @@ export default class Auto {
1310
}
1311
1312
if (!pr || !build) {
1313
- canaryIdentifier = `${canaryIdentifier}.${(
1314
- await this.git.getSha(true)
1315
- ).slice(0, 7)}`;
+ const sha = await this.git.getSha();
+ // If the commit sha is a 7 digit number starting with zero
+ // SemVer will reject the version. Include enough of the sha
1316
+ // to include at least one letter in that case.
1317
+ const endIndex = /^0\d{6}/.test(sha) ?
1318
+ sha.search(/[a-zA-Z]/) + 1
1319
+ : 7;
1320
+ canaryIdentifier = `${canaryIdentifier}.${sha.slice(0, endIndex)}`;
1321
1322
1323
canaryIdentifier = `-canary${canaryIdentifier}`;
0 commit comments