diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2637e5f..8229413 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,6 +39,7 @@ jobs: repo: https://github.com/dawidd6/deber.git ref: v1.0.0 lintian_opts: "-v" + install_skopeo: true - package: netcat-openbsd arch: arm64 repo: https://git.launchpad.net/ubuntu/+source/netcat-openbsd @@ -52,8 +53,14 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + - name: Clone repo run: git clone --depth=1 ${{matrix.repo}} -b ${{matrix.ref}} ${{matrix.package}} + + - name: Remove skopeo (for testing installation) + if: ${{matrix.install_skopeo}} + run: sudo apt-get remove -y skopeo + - name: Test run uses: ./ with: @@ -61,7 +68,8 @@ jobs: source_directory: ${{matrix.package}} artifacts_directory: artifacts lintian_opts: ${{matrix.lintian_opts}} - lintian_run: ${{matrix.lintian_run || false }} + lintian_run: ${{matrix.lintian_run || false}} + - name: Check files run: | ls -lh artifacts/${{matrix.package}}*.* diff --git a/main.js b/main.js index 7b214bc..148781a 100644 --- a/main.js +++ b/main.js @@ -1,5 +1,6 @@ const core = require("@actions/core") const exec = require("@actions/exec") +const io = require('@actions/io') const firstline = require("firstline") const path = require("path") const fs = require("fs") @@ -16,6 +17,21 @@ 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 {