@@ -86105,27 +86105,29 @@ const runImageDiffPlugin = (taskId, taskConfig, { ghToken, ghRepository: { repo,
86105
86105
const filename = (0,external_path_.basename)(taskConfig.image).split('.')[0];
86106
86106
const imagePath = `${currentDirectory}/${uuid}-image-${filename}.png`;
86107
86107
core.info(`[${taskId}] Converting image ${taskConfig.image} to ${imagePath}...`);
86108
- yield dist_default().read(external_fs_default().readFileSync(taskConfig.image), (error, image) => {
86109
- if (error) {
86110
- core.error(`[${taskId}] Error reading image: ${error}`);
86111
- throw error;
86112
- }
86113
- image.write(imagePath);
86114
- });
86108
+ try {
86109
+ const imageFile = yield dist_default().read(taskConfig.image);
86110
+ yield imageFile.writeAsync(imagePath);
86111
+ }
86112
+ catch (error) {
86113
+ core.error(`[${taskId}] Failed to read image ${taskConfig.image}: ${error}`);
86114
+ return;
86115
+ }
86115
86116
core.info(`[${taskId}] Converted image ${taskConfig.image} to ${imagePath}`);
86116
86117
const imagePng = png/* PNG.sync.read */.y.sync.read(external_fs_default().readFileSync(imagePath));
86117
86118
const { width, height } = imagePng;
86118
86119
core.info(`Image size: ${width} x ${height}`);
86119
86120
// read baseline and resize
86120
86121
const baselinePath = `${currentDirectory}/${uuid}-baseline.png`;
86121
86122
core.info(`[${taskId}] Converting baseline ${taskConfig.baseline} to ${baselinePath}...`);
86122
- yield dist_default().read(external_fs_default().readFileSync(taskConfig.baseline), (error, image) => {
86123
- if (error) {
86124
- core.error(`[${taskId}] Error reading baseline: ${error}`);
86125
- throw error;
86126
- }
86127
- image.resize(width, height).write(baselinePath);
86128
- });
86123
+ try {
86124
+ const baselineFile = yield dist_default().read(taskConfig.baseline);
86125
+ yield baselineFile.resize(width, height).writeAsync(baselinePath);
86126
+ }
86127
+ catch (error) {
86128
+ core.error(`[${taskId}] Failed to read baseline ${taskConfig.baseline}: ${error}`);
86129
+ return;
86130
+ }
86129
86131
core.info(`[${taskId}] Converted baseline ${taskConfig.baseline} to ${baselinePath}`);
86130
86132
const baselinePng = png/* PNG.sync.read */.y.sync.read(external_fs_default().readFileSync(baselinePath));
86131
86133
// create diff
@@ -86585,8 +86587,9 @@ function run(stoatConfig) {
86585
86587
else {
86586
86588
core.info(`Detected pull request number: ${pullRequestNumber}`);
86587
86589
}
86588
- core.info(`Fetching repo's SHA ( not the build's merge commit SHA)...`);
86590
+ // this is not the build's merge commit SHA
86589
86591
const repoSha = core.getInput('actual_sha');
86592
+ core.info(`Repo SHA: ${repoSha}`);
86590
86593
const ghBranch = core.getInput('pr_branch_name');
86591
86594
yield waitForStoatDevServer(github.context.repo, ghBranch, repoSha);
86592
86595
core.info('Checking if prior steps succeeded...');
0 commit comments