@@ -57499,6 +57499,7 @@ function checkAuthError(error) {
5749957499 }
5750057500}
5750157501async function GetAppId(project) {
57502+ var _a, _b, _c;
5750257503 await getOrCreateClient(project);
5750357504 const { data: response, error } = await appStoreConnectClient.api.AppsService.appsGetCollection({
5750457505 query: { 'filter[bundleId]': [project.bundleId] }
@@ -57513,6 +57514,15 @@ async function GetAppId(project) {
5751357514 if (response.data.length === 0) {
5751457515 throw new Error(`No apps found for bundle id ${project.bundleId}`);
5751557516 }
57517+ if (response.data.length > 1) {
57518+ core.warning(`Multiple apps found for bundle id ${project.bundleId}!`);
57519+ for (const app of response.data) {
57520+ core.info(`[${app.id}] ${(_a = app.attributes) === null || _a === void 0 ? void 0 : _a.bundleId}`);
57521+ if (project.bundleId.length === ((_c = (_b = app.attributes) === null || _b === void 0 ? void 0 : _b.bundleId) === null || _c === void 0 ? void 0 : _c.length)) {
57522+ return app.id;
57523+ }
57524+ }
57525+ }
5751657526 return response.data[0].id;
5751757527}
5751857528async function GetLatestBundleVersion(project) {
@@ -57684,7 +57694,7 @@ async function pollForValidBuild(project, maxRetries = 60, interval = 30) {
5768457694 core.debug(`Polling build validation...`);
5768557695 await new Promise(resolve => setTimeout(resolve, interval * 1000));
5768657696 let retries = 0;
57687- while (retries < maxRetries) {
57697+ while (++ retries < maxRetries) {
5768857698 core.info(`Polling for build... Attempt ${retries}/${maxRetries}`);
5768957699 let { preReleaseVersion, build } = await getLastPreReleaseVersionAndBuild(project);
5769057700 if (preReleaseVersion) {
@@ -58157,7 +58167,7 @@ async function GetProjectDetails(credential, xcodeVersion) {
5815758167 finally {
5815858168 await plistHandle.close();
5815958169 }
58160- core.info(`----- Info.plist content: -----\n${infoPlistContent}\n-----------------------------------`);
58170+ core.info(`------- Info.plist content: -- -----\n${infoPlistContent}\n-----------------------------------`);
5816158171 return projectRef;
5816258172}
5816358173async function checkSimulatorsAvailable(platform) {
@@ -58506,7 +58516,7 @@ async function getExportOptions(projectRef) {
5850658516 const exportOptionsHandle = await fs.promises.open(exportOptionsPath, fs.constants.O_RDONLY);
5850758517 try {
5850858518 const exportOptionContent = await fs.promises.readFile(exportOptionsHandle, 'utf8');
58509- core.info(`----- Export options content: -----${exportOptionContent}\n-----------------------------------`);
58519+ core.info(`----- Export options content: -----\n ${exportOptionContent}\n-----------------------------------`);
5851058520 const exportOptions = plist.parse(exportOptionContent);
5851158521 projectRef.exportOption = exportOptions['method'];
5851258522 }
@@ -58718,7 +58728,7 @@ async function UploadApp(projectRef) {
5871858728 core.debug(outputJson);
5871958729 try {
5872058730 const whatsNew = await getWhatsNew();
58721- core.info(`\n-------------- what's new --------------\n${whatsNew}\n------------------------------------------\n`);
58731+ core.info(`\n--------------- what's new - --------------\n${whatsNew}\n------------------------------------------\n`);
5872258732 await (0, AppStoreConnectClient_1.UpdateTestDetails)(projectRef, whatsNew);
5872358733 }
5872458734 catch (error) {
0 commit comments