From 7b7e0d633a4f9e0e140e8bcfab3a4a40a85df6bb Mon Sep 17 00:00:00 2001 From: Josh Dolitsky Date: Mon, 17 Jul 2023 14:09:14 -0500 Subject: [PATCH] move some stuff around Signed-off-by: Josh Dolitsky --- action.yml | 55 +++++++++++++++++++++++++++++++++------------------- wolfi-act.sh | 25 ++++++++++++++---------- 2 files changed, 50 insertions(+), 30 deletions(-) diff --git a/action.yml b/action.yml index 4119d2e..10d24aa 100644 --- a/action.yml +++ b/action.yml @@ -4,24 +4,33 @@ inputs: packages: description: "Comma-separated list of Wolfi packages to install" required: true - default: "grype" command: description: "Command to run" required: true - default: "echo \"Hello from wolfi-act!\"" apko-image: description: "The apko image to build with" required: true default: "ghcr.io/wolfi-dev/apko:latest" + debug: + description: "Whether or not to add debug logging" + required: false + default: 'false' runs: using: "composite" steps: - shell: bash run: | - set -ex - trap "rm -f wolfi-act.apko.config wolfi-act.tar" EXIT + set -e - cat >./wolfi-act.apko.config <./wolfi-act.apko.config.yaml <./wolfi-act.apko.config <./wolfi-act.apko.config.yaml </dev/null +echo "done." -docker load < wolfi-act.tar +printf "Loading ephemeral container image into Docker... " +docker load < wolfi-act.tar >/dev/null +echo "done." -docker run --rm --platform linux/amd64 \ +echo "Running the following command in ephemeral container image: ${CMD}" +echo "Output:" +docker run -i --rm --platform linux/amd64 \ -v ${PWD}:/work \ -w /work \ wolfi-act:latest \ - bash -exc "${CMD}" + bash -ec "${CMD}"