@@ -125,15 +125,15 @@ runs:
125125
126126 // Helper function to tag single-platform image
127127 async function tagSinglePlatformImage(builtImage, imagesWithTags) {
128- core.info(`Skipping multiarch manifest creation for "${builtImage.name}" (single platform: ${builtImage.platforms[0] || 'none'} )`);
128+ core.info(`Tagging single-platform image "${builtImage.name}" (skipping multiarch manifest creation )`);
129129
130130 validateImage(builtImage);
131131
132132 const sourceImage = builtImage.images[0];
133133 for (const targetImage of imagesWithTags) {
134134 const tagCommand = `docker buildx imagetools create --tag ${targetImage} ${sourceImage}`;
135135 await exec.exec(tagCommand);
136- core.debug(`Tag single-platform image "${builtImage.name}" ("${tagCommand}") executed `);
136+ core.debug(`Tagged single-platform image "${builtImage.name}"`);
137137 }
138138
139139 builtImage.images = imagesWithTags;
@@ -173,7 +173,19 @@ runs:
173173 return new Promise(async (resolve, reject) => {
174174 try {
175175 if (builtImage.platforms.length <= 1) {
176- await tagSinglePlatformImage(builtImage, imagesWithTags);
176+ // For single-platform builds pushed with tags (not by digest),
177+ // the image reference already includes the tag, so we just need to update the images array
178+ const sourceImage = builtImage.images[0];
179+ const isPushedByDigest = sourceImage.match(/@sha256:[a-f0-9]{64}$/) && !sourceImage.match(/:[^:@]+@sha256:/);
180+
181+ if (isPushedByDigest) {
182+ // Image was pushed by digest only, need to tag it
183+ await tagSinglePlatformImage(builtImage, imagesWithTags);
184+ } else {
185+ // Image was already pushed with tags, just ensure images array is updated
186+ core.info(`Single-platform image "${builtImage.name}" was already pushed with tags`);
187+ builtImage.images = imagesWithTags;
188+ }
177189 } else {
178190 await createMultiarchManifest(builtImage, imagesWithTags);
179191 }
0 commit comments