From 2754bd63e5993b4a4709f2f341980b6adeddca22 Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Thu, 4 Jan 2024 19:36:01 +0100 Subject: [PATCH] Adding installation of skopeo Since other platforms, beside Github Actions, can use Actions (see https://forgejo.org/docs/v1.21/user/actions/), it is not save to assume skopeo is installed by default. --- main.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/main.js b/main.js index 7b214bc..e41752d 100644 --- a/main.js +++ b/main.js @@ -16,9 +16,25 @@ function getImageTag(imageName, distribution) { } async function getImageName(distribution) { + const io = require('@actions/io') 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",