Skip to content

Commit 39e2c9c

Browse files
danadajianclaude
andauthored
refactor(action): cleanup logging (#731)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: danadajian <danadajian@users.noreply.github.com>
1 parent d1054d5 commit 39e2c9c

File tree

4 files changed

+13
-29
lines changed

4 files changed

+13
-29
lines changed

action/dist/main.js

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -159748,9 +159748,6 @@ async function uploadLocalDirectoryWithResize(localDir, bucketName, s3Prefix) {
159748159748
(other) => path4.dirname(other) === path4.dirname(file) && path4.basename(other) === "new.png"
159749159749
)
159750159750
);
159751-
info(
159752-
`Uploading ${filesFromFailingTests.length} file(s) from ${localDir} to s3://${bucketName}/${s3Prefix}`
159753-
);
159754159751
await (0, import_bluebird.map)(filesFromFailingTests, async (file) => {
159755159752
const localFilePath = path4.join(localDir, file);
159756159753
const s3Key = path4.join(s3Prefix, file);
@@ -159762,9 +159759,11 @@ async function uploadLocalDirectoryWithResize(localDir, bucketName, s3Prefix) {
159762159759
Body: resizedBuffer
159763159760
});
159764159761
});
159765-
info(
159766-
`Uploaded ${filesFromFailingTests.length} file(s) to s3://${bucketName}/${s3Prefix}`
159767-
);
159762+
if (filesFromFailingTests.length) {
159763+
info(
159764+
`Uploaded ${filesFromFailingTests.length} file(s) to s3://${bucketName}/${s3Prefix}`
159765+
);
159766+
}
159768159767
}
159769159768
async function uploadSingleFile(localFilePath, s3Key) {
159770159769
const bucketName = getInput("bucket-name", { required: true });
@@ -159835,9 +159834,6 @@ async function uploadOriginalNewPngs(localDir, bucketName, s3Prefix) {
159835159834
nodir: true,
159836159835
absolute: false
159837159836
});
159838-
info(
159839-
`Uploading ${files.length} original new.png file(s) from ${localDir} to s3://${bucketName}/${s3Prefix}`
159840-
);
159841159837
await (0, import_bluebird.map)(files, async (file) => {
159842159838
const localFilePath = path4.join(localDir, file);
159843159839
const s3Key = path4.join(s3Prefix, file);
@@ -163917,9 +163913,6 @@ var run = async () => {
163917163913
);
163918163914
return;
163919163915
}
163920-
info(
163921-
`${diffFileCount} visual differences found, and ${newFileCount} new images found.`
163922-
);
163923163916
if (diffFileCount === 0 && newFileCount > 0) {
163924163917
info(
163925163918
`New visual tests found! ${newFileCount} images will be uploaded as new base images.`
@@ -163935,6 +163928,7 @@ var run = async () => {
163935163928
...context2.repo
163936163929
});
163937163930
}
163931+
info(`${diffFileCount} visual differences found.`);
163938163932
await Promise.all([uploadAllImages(hash), uploadOriginalNewImages(hash)]);
163939163933
if (!commitHash) return;
163940163934
await octokit.rest.repos.createCommitStatus({

action/dist/main.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.

action/src/run.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,6 @@ export const run = async () => {
149149
return;
150150
}
151151

152-
info(
153-
`${diffFileCount} visual differences found, and ${newFileCount} new images found.`
154-
);
155-
156152
if (diffFileCount === 0 && newFileCount > 0) {
157153
info(
158154
`New visual tests found! ${newFileCount} images will be uploaded as new base images.`
@@ -169,6 +165,7 @@ export const run = async () => {
169165
});
170166
}
171167

168+
info(`${diffFileCount} visual differences found.`);
172169
await Promise.all([uploadAllImages(hash), uploadOriginalNewImages(hash)]);
173170
if (!commitHash) return;
174171
await octokit.rest.repos.createCommitStatus({

action/src/s3-operations.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,6 @@ async function uploadLocalDirectoryWithResize(
8989
)
9090
);
9191

92-
info(
93-
`Uploading ${filesFromFailingTests.length} file(s) from ${localDir} to s3://${bucketName}/${s3Prefix}`
94-
);
95-
9692
await map(filesFromFailingTests, async file => {
9793
const localFilePath = path.join(localDir, file);
9894
const s3Key = path.join(s3Prefix, file);
@@ -107,9 +103,11 @@ async function uploadLocalDirectoryWithResize(
107103
});
108104
});
109105

110-
info(
111-
`Uploaded ${filesFromFailingTests.length} file(s) to s3://${bucketName}/${s3Prefix}`
112-
);
106+
if (filesFromFailingTests.length) {
107+
info(
108+
`Uploaded ${filesFromFailingTests.length} file(s) to s3://${bucketName}/${s3Prefix}`
109+
);
110+
}
113111
}
114112

115113
async function uploadSingleFile(
@@ -196,11 +194,6 @@ async function uploadOriginalNewPngs(
196194
nodir: true,
197195
absolute: false
198196
});
199-
200-
info(
201-
`Uploading ${files.length} original new.png file(s) from ${localDir} to s3://${bucketName}/${s3Prefix}`
202-
);
203-
204197
await map(files, async file => {
205198
const localFilePath = path.join(localDir, file);
206199
const s3Key = path.join(s3Prefix, file);

0 commit comments

Comments
 (0)