forked from waja/action-debian-package
main: check for skopeo only once
This commit is contained in:
parent
e4bbe94be9
commit
8fe07bfb48
30
main.js
30
main.js
|
@ -17,24 +17,24 @@ function getImageTag(imageName, distribution) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getImageName(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)
|
const tag = getImageTag("", distribution)
|
||||||
for (const image of ["debian", "ubuntu"]) {
|
for (const image of ["debian", "ubuntu"]) {
|
||||||
try {
|
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")
|
core.startGroup("Get image name")
|
||||||
await exec.exec("skopeo", [
|
await exec.exec("skopeo", [
|
||||||
"inspect",
|
"inspect",
|
||||||
|
|
Loading…
Reference in a new issue