Skip to content

Commit b1c2d1e

Browse files
committed
debug: add extensive logging to diagnose empty JSON output
1 parent 2b305e0 commit b1c2d1e

3 files changed

Lines changed: 41 additions & 3 deletions

File tree

github-action/dist/index.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2251,24 +2251,42 @@ function runMain() {
22512251
const imageSource = `oci-archive:/tmp/output.tar:${tag}`;
22522252
const imageDest = `docker://${imageName}:${finalTag}`;
22532253
core.info(`Copying multiplatform image to architecture-specific tag: ${imageName}:${finalTag}`);
2254-
yield (0, skopeo_1.copyImage)(true, imageSource, imageDest);
2254+
core.info(`Copy source: ${imageSource}`);
2255+
core.info(`Copy destination: ${imageDest}`);
2256+
try {
2257+
yield (0, skopeo_1.copyImage)(true, imageSource, imageDest);
2258+
core.info(`Successfully copied image to ${finalTag}`);
2259+
}
2260+
catch (error) {
2261+
core.error(`Failed to copy image to ${finalTag}: ${error}`);
2262+
throw error;
2263+
}
22552264
}
22562265
// Extract digest from registry AFTER push to get the actual registry digest
22572266
for (const tag of imageTagArray) {
22582267
const finalTag = platform ? `${tag}-${platform.replace('/', '-')}` : tag;
2268+
core.info(`Attempting to inspect registry image: ${imageName}:${finalTag}`);
22592269
const inspectCmd = yield (0, exec_1.exec)('docker', ['buildx', 'imagetools', 'inspect', `${imageName}:${finalTag}`, '--format', '{{.Manifest.Digest}}'], { silent: true });
2270+
core.info(`Inspect command exit code: ${inspectCmd.exitCode}`);
2271+
core.info(`Inspect command stdout: "${inspectCmd.stdout}"`);
2272+
core.info(`Inspect command stderr: "${inspectCmd.stderr}"`);
22602273
if (inspectCmd.exitCode === 0) {
22612274
const digest = inspectCmd.stdout.trim();
2275+
core.info(`Raw digest output: "${digest}"`);
22622276
if (digest && digest.startsWith('sha256:')) {
22632277
core.info(`Image digest for ${platform}: ${digest}`);
22642278
digestsObj[platform] = digest;
22652279
break; // Found digest, stop looking
22662280
}
2281+
else {
2282+
core.warning(`Invalid digest format: "${digest}"`);
2283+
}
22672284
}
22682285
else {
22692286
core.warning(`Failed to inspect registry image for ${finalTag}: ${inspectCmd.stderr}`);
22702287
}
22712288
}
2289+
core.info(`Final digestsObj: ${JSON.stringify(digestsObj)}`);
22722290
}
22732291
else if (imageName) {
22742292
// For non-platform specific builds, use local docker inspect

github-action/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.

github-action/src/main.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,29 +154,49 @@ export async function runMain(): Promise<void> {
154154
const imageSource = `oci-archive:/tmp/output.tar:${tag}`;
155155
const imageDest = `docker://${imageName}:${finalTag}`;
156156
core.info(`Copying multiplatform image to architecture-specific tag: ${imageName}:${finalTag}`);
157-
await copyImage(true, imageSource, imageDest);
157+
core.info(`Copy source: ${imageSource}`);
158+
core.info(`Copy destination: ${imageDest}`);
159+
160+
try {
161+
await copyImage(true, imageSource, imageDest);
162+
core.info(`Successfully copied image to ${finalTag}`);
163+
} catch (error) {
164+
core.error(`Failed to copy image to ${finalTag}: ${error}`);
165+
throw error;
166+
}
158167
}
159168

160169
// Extract digest from registry AFTER push to get the actual registry digest
161170
for (const tag of imageTagArray) {
162171
const finalTag = platform ? `${tag}-${platform.replace('/', '-')}` : tag;
172+
core.info(`Attempting to inspect registry image: ${imageName}:${finalTag}`);
173+
163174
const inspectCmd = await exec(
164175
'docker',
165176
['buildx', 'imagetools', 'inspect', `${imageName}:${finalTag}`, '--format', '{{.Manifest.Digest}}'],
166177
{silent: true}
167178
);
168179

180+
core.info(`Inspect command exit code: ${inspectCmd.exitCode}`);
181+
core.info(`Inspect command stdout: "${inspectCmd.stdout}"`);
182+
core.info(`Inspect command stderr: "${inspectCmd.stderr}"`);
183+
169184
if (inspectCmd.exitCode === 0) {
170185
const digest = inspectCmd.stdout.trim();
186+
core.info(`Raw digest output: "${digest}"`);
171187
if (digest && digest.startsWith('sha256:')) {
172188
core.info(`Image digest for ${platform}: ${digest}`);
173189
digestsObj[platform] = digest;
174190
break; // Found digest, stop looking
191+
} else {
192+
core.warning(`Invalid digest format: "${digest}"`);
175193
}
176194
} else {
177195
core.warning(`Failed to inspect registry image for ${finalTag}: ${inspectCmd.stderr}`);
178196
}
179197
}
198+
199+
core.info(`Final digestsObj: ${JSON.stringify(digestsObj)}`);
180200
} else if (imageName) {
181201
// For non-platform specific builds, use local docker inspect
182202
const inspectCmd = await exec(

0 commit comments

Comments
 (0)