Skip to content

Commit 42db137

Browse files
fix leading 0s
1 parent 0ba2788 commit 42db137

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

dist/index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57696,9 +57696,11 @@ async function pollForValidBuild(project, maxRetries = 60, interval = 30) {
5769657696
if (!build) {
5769757697
throw new Error(`Build ${preReleaseVersion.id} not found!`);
5769857698
}
57699-
switch ((_a = build.attributes) === null || _a === void 0 ? void 0 : _a.processingState) {
57699+
const normalizedBuildVersion = normalizeVersion((_a = build.attributes) === null || _a === void 0 ? void 0 : _a.version);
57700+
const normalizedProjectVersion = normalizeVersion(project.bundleVersion);
57701+
switch ((_b = build.attributes) === null || _b === void 0 ? void 0 : _b.processingState) {
5770057702
case 'VALID':
57701-
if (((_b = build.attributes) === null || _b === void 0 ? void 0 : _b.version) === project.bundleVersion) {
57703+
if (normalizedBuildVersion === normalizedProjectVersion) {
5770257704
core.info(`Build ${build.attributes.version} is valid`);
5770357705
return build;
5770457706
}
@@ -57730,6 +57732,9 @@ async function UpdateTestDetails(project, whatsNew) {
5773057732
await updateBetaBuildLocalization(betaBuildLocalization, whatsNew);
5773157733
}
5773257734
}
57735+
function normalizeVersion(version) {
57736+
return version.split('.').map(part => parseInt(part, 10).toString()).join('.');
57737+
}
5773357738

5773457739

5773557740
/***/ }),

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/AppStoreConnectClient.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,11 @@ async function pollForValidBuild(project: XcodeProject, maxRetries: number = 60,
252252
if (!build) {
253253
throw new Error(`Build ${preReleaseVersion.id} not found!`);
254254
}
255+
const normalizedBuildVersion = normalizeVersion(build.attributes?.version);
256+
const normalizedProjectVersion = normalizeVersion(project.bundleVersion);
255257
switch (build.attributes?.processingState) {
256258
case 'VALID':
257-
if (build.attributes?.version === project.bundleVersion) {
259+
if (normalizedBuildVersion === normalizedProjectVersion) {
258260
core.info(`Build ${build.attributes.version} is valid`);
259261
return build;
260262
} else {
@@ -285,3 +287,7 @@ export async function UpdateTestDetails(project: XcodeProject, whatsNew: string)
285287
await updateBetaBuildLocalization(betaBuildLocalization, whatsNew);
286288
}
287289
}
290+
291+
function normalizeVersion(version: string): string {
292+
return version.split('.').map(part => parseInt(part, 10).toString()).join('.');
293+
}

0 commit comments

Comments
 (0)