Skip to content

Commit fe412c9

Browse files
disable some logging
1 parent 1c9c09e commit fe412c9

4 files changed

Lines changed: 17 additions & 18 deletions

File tree

dist/index.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57516,9 +57516,9 @@ async function GetAppId(project) {
5751657516
throw new Error(`No apps found for bundle id ${project.bundleId}`);
5751757517
}
5751857518
if (response.data.length > 1) {
57519-
core.warning(`Multiple apps found for bundle id ${project.bundleId}!`);
57519+
(0, utilities_1.log)(`Multiple apps found for bundle id ${project.bundleId}!`);
5752057520
for (const app of response.data) {
57521-
core.info(`[${app.id}] ${(_a = app.attributes) === null || _a === void 0 ? void 0 : _a.bundleId}`);
57521+
(0, utilities_1.log)(`[${app.id}] ${(_a = app.attributes) === null || _a === void 0 ? void 0 : _a.bundleId}`);
5752257522
if (project.bundleId.length === ((_c = (_b = app.attributes) === null || _b === void 0 ? void 0 : _b.bundleId) === null || _c === void 0 ? void 0 : _c.length)) {
5752357523
return app.id;
5752457524
}
@@ -57682,17 +57682,15 @@ async function updateBetaBuildLocalization(betaBuildLocalization, whatsNew) {
5768257682
path: { id: betaBuildLocalization.id },
5768357683
body: updateBuildLocalization
5768457684
});
57685-
const responseJson = JSON.stringify(updateBuildLocalization, null, 2);
5768657685
if (updateError) {
5768757686
checkAuthError(updateError);
5768857687
throw new Error(`Error updating beta build localization: ${JSON.stringify(updateError, null, 2)}`);
5768957688
}
57690-
(0, utilities_1.log)(responseJson);
5769157689
return betaBuildLocalization;
5769257690
}
5769357691
async function pollForValidBuild(project, maxRetries = 60, interval = 30) {
5769457692
var _a, _b, _c;
57695-
core.debug(`Polling build validation...`);
57693+
(0, utilities_1.log)(`Polling build validation...`);
5769657694
await new Promise(resolve => setTimeout(resolve, interval * 1000));
5769757695
let retries = 0;
5769857696
while (++retries < maxRetries) {
@@ -57712,7 +57710,7 @@ async function pollForValidBuild(project, maxRetries = 60, interval = 30) {
5771257710
return build;
5771357711
}
5771457712
else {
57715-
core.info(`Build ${build.attributes.version} is VALID but not the latest version ${project.bundleVersion}!`);
57713+
core.info(`Waiting for ${project.bundleVersion}...`);
5771657714
}
5771757715
break;
5771857716
case 'FAILED':
@@ -57724,11 +57722,11 @@ async function pollForValidBuild(project, maxRetries = 60, interval = 30) {
5772457722
}
5772557723
}
5772657724
else {
57727-
core.info(`No build found for ${(_c = preReleaseVersion.attributes) === null || _c === void 0 ? void 0 : _c.version}!`);
57725+
core.info(`Waiting for build ${(_c = preReleaseVersion.attributes) === null || _c === void 0 ? void 0 : _c.version}...`);
5772857726
}
5772957727
}
5773057728
else {
57731-
core.info(`No pre-release version found for ${project.versionString}!`);
57729+
core.info(`Waiting for pre-release build ${project.versionString}...`);
5773257730
}
5773357731
await new Promise(resolve => setTimeout(resolve, interval * 1000));
5773457732
}
@@ -57958,6 +57956,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
5795857956
exports.log = log;
5795957957
const core = __nccwpck_require__(2186);
5796057958
function log(message, type = 'info') {
57959+
if (type == 'info' && !core.isDebug()) {
57960+
return;
57961+
}
5796157962
const lines = message.split('\n');
5796257963
const filteredLines = lines.filter((line) => line.trim() !== '');
5796357964
const uniqueLines = Array.from(new Set(filteredLines));

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: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ export async function GetAppId(project: XcodeProject): Promise<string> {
6565
throw new Error(`No apps found for bundle id ${project.bundleId}`);
6666
}
6767
if (response.data.length > 1) {
68-
core.warning(`Multiple apps found for bundle id ${project.bundleId}!`);
68+
log(`Multiple apps found for bundle id ${project.bundleId}!`);
6969
for (const app of response.data) {
70-
core.info(`[${app.id}] ${app.attributes?.bundleId}`);
70+
log(`[${app.id}] ${app.attributes?.bundleId}`);
7171
if (project.bundleId.length === app.attributes?.bundleId?.length) {
7272
return app.id;
7373
}
@@ -237,17 +237,15 @@ async function updateBetaBuildLocalization(betaBuildLocalization: BetaBuildLocal
237237
path: { id: betaBuildLocalization.id },
238238
body: updateBuildLocalization
239239
});
240-
const responseJson = JSON.stringify(updateBuildLocalization, null, 2);
241240
if (updateError) {
242241
checkAuthError(updateError);
243242
throw new Error(`Error updating beta build localization: ${JSON.stringify(updateError, null, 2)}`);
244243
}
245-
log(responseJson);
246244
return betaBuildLocalization;
247245
}
248246

249247
async function pollForValidBuild(project: XcodeProject, maxRetries: number = 60, interval: number = 30): Promise<Build> {
250-
core.debug(`Polling build validation...`);
248+
log(`Polling build validation...`);
251249
await new Promise(resolve => setTimeout(resolve, interval * 1000));
252250
let retries = 0;
253251
while (++retries < maxRetries) {
@@ -266,7 +264,7 @@ async function pollForValidBuild(project: XcodeProject, maxRetries: number = 60,
266264
core.info(`Build ${build.attributes.version} is VALID`);
267265
return build;
268266
} else {
269-
core.info(`Build ${build.attributes.version} is VALID but not the latest version ${project.bundleVersion}!`);
267+
core.info(`Waiting for ${project.bundleVersion}...`);
270268
}
271269
break;
272270
case 'FAILED':
@@ -277,10 +275,10 @@ async function pollForValidBuild(project: XcodeProject, maxRetries: number = 60,
277275
break;
278276
}
279277
} else {
280-
core.info(`No build found for ${preReleaseVersion.attributes?.version}!`);
278+
core.info(`Waiting for build ${preReleaseVersion.attributes?.version}...`);
281279
}
282280
} else {
283-
core.info(`No pre-release version found for ${project.versionString}!`);
281+
core.info(`Waiting for pre-release build ${project.versionString}...`);
284282
}
285283
await new Promise(resolve => setTimeout(resolve, interval * 1000));
286284
}

src/utilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import core = require('@actions/core');
33

44
export function log(message: string, type: 'info' | 'warning' | 'error' = 'info') {
5-
// if (type == 'info' && !core.isDebug()) { return; }
5+
if (type == 'info' && !core.isDebug()) { return; }
66
const lines = message.split('\n');
77
const filteredLines = lines.filter((line) => line.trim() !== '');
88
const uniqueLines = Array.from(new Set(filteredLines));

0 commit comments

Comments
 (0)