main: check for skopeo only once

This commit is contained in:
Dawid Dziurla 2024-01-06 13:36:16 +01:00
parent e4bbe94be9
commit 8fe07bfb48
No known key found for this signature in database
GPG key ID: 7B6D8368172E9B0B

View file

@ -17,10 +17,7 @@ function getImageTag(imageName, distribution) {
}
async function getImageName(distribution) {
const tag = getImageTag("", distribution)
for (const image of ["debian", "ubuntu"]) {
try {
const skopeoPath = await io.which('skopeo', true)
const skopeoPath = await io.which('skopeo', false)
if (!skopeoPath) {
core.startGroup("Install skopeo")
await exec.exec("sudo", [
@ -35,6 +32,9 @@ async function getImageName(distribution) {
])
core.endGroup()
}
const tag = getImageTag("", distribution)
for (const image of ["debian", "ubuntu"]) {
try {
core.startGroup("Get image name")
await exec.exec("skopeo", [
"inspect",