Fix multiple tags push bug (#59)

Signed-off-by: divyansh42 <diagrawa@redhat.com>
This commit is contained in:
Divyanshu Agrawal 2021-11-17 12:29:44 +05:30 committed by GitHub
parent 42e9b87b01
commit 61659a2275
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 8 deletions

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View file

@ -189,7 +189,7 @@ async function run(): Promise<void> {
); );
} }
let pushMsg = `⏳ Pushing "${sourceImages[0]}" to ${destinationImages.join(", ")}`; let pushMsg = `⏳ Pushing "${sourceImages.join(", ")}" to "${destinationImages.join(", ")}" respectively`;
if (username) { if (username) {
pushMsg += ` as "${username}"`; pushMsg += ` as "${username}"`;
} }
@ -215,15 +215,15 @@ async function run(): Promise<void> {
} }
// push the image // push the image
for (const destinationImage of destinationImages) { for (let i = 0; i < destinationImages.length; i++) {
const args = [ const args = [
...(isImageFromDocker ? dockerPodmanOpts : []), ...(isImageFromDocker ? dockerPodmanOpts : []),
"push", "push",
"--quiet", "--quiet",
"--digestfile", "--digestfile",
digestFile, digestFile,
isImageFromDocker ? getFullDockerImageName(sourceImages[0]) : sourceImages[0], isImageFromDocker ? getFullDockerImageName(sourceImages[i]) : sourceImages[i],
destinationImage, destinationImages[i],
]; ];
if (podmanExtraArgs.length > 0) { if (podmanExtraArgs.length > 0) {
@ -241,9 +241,9 @@ async function run(): Promise<void> {
} }
await execute(await getPodmanPath(), args); await execute(await getPodmanPath(), args);
core.info(`✅ Successfully pushed "${sourceImages[0]}" to "${destinationImage}"`); core.info(`✅ Successfully pushed "${sourceImages[i]}" to "${destinationImages[i]}"`);
registryPathList.push(destinationImage); registryPathList.push(destinationImages[i]);
try { try {
const digest = (await fs.promises.readFile(digestFile)).toString(); const digest = (await fs.promises.readFile(digestFile)).toString();