Skip to content

Commit

Permalink
main: check for skopeo only once
Browse files Browse the repository at this point in the history
  • Loading branch information
dawidd6 committed Jan 6, 2024
1 parent e4bbe94 commit 8fe07bf
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ function getImageTag(imageName, distribution) {
}

async function getImageName(distribution) {
const skopeoPath = await io.which('skopeo', false)
if (!skopeoPath) {
core.startGroup("Install skopeo")
await exec.exec("sudo", [
"apt-get",
"update"
])
await exec.exec("sudo", [
"apt-get",
"-y",
"install",
"skopeo"
])
core.endGroup()
}
const tag = getImageTag("", distribution)
for (const image of ["debian", "ubuntu"]) {
try {
const skopeoPath = await io.which('skopeo', true)
if (!skopeoPath) {
core.startGroup("Install skopeo")
await exec.exec("sudo", [
"apt-get",
"update"
])
await exec.exec("sudo", [
"apt-get",
"-y",
"install",
"skopeo"
])
core.endGroup()
}
core.startGroup("Get image name")
await exec.exec("skopeo", [
"inspect",
Expand Down

0 comments on commit 8fe07bf

Please sign in to comment.