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) {
pushMsg += ` as "${username}"`;
}
@ -215,15 +215,15 @@ async function run(): Promise<void> {
}
// push the image
for (const destinationImage of destinationImages) {
for (let i = 0; i < destinationImages.length; i++) {
const args = [
...(isImageFromDocker ? dockerPodmanOpts : []),
"push",
"--quiet",
"--digestfile",
digestFile,
isImageFromDocker ? getFullDockerImageName(sourceImages[0]) : sourceImages[0],
destinationImage,
isImageFromDocker ? getFullDockerImageName(sourceImages[i]) : sourceImages[i],
destinationImages[i],
];
if (podmanExtraArgs.length > 0) {
@ -241,9 +241,9 @@ async function run(): Promise<void> {
}
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 {
const digest = (await fs.promises.readFile(digestFile)).toString();