Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cpanato committed Jul 18, 2023
1 parent 8ce97fc commit e7e354d
Showing 1 changed file with 21 additions and 38 deletions.
59 changes: 21 additions & 38 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ runs:
run: |
set -e
debug_args=
debug_args_image="-exc"
debug='${{inputs.debug}}'
if [[ "${debug}" == "true" ]]; then
echo "[πŸ™] Enabling debug logging."
set -x
debug_args="2>/dev/null"
debug_args_image="-ec"
fi
if [[ '${{inputs.command}}' == '' ]]; then
Expand Down Expand Up @@ -55,29 +59,17 @@ runs:
fi
printf "[πŸ™] Building ephemeral container image from Wolfi packages... "
if [[ "${debug}" == "true" ]]; then
docker run --rm \
-v ${PWD}:/work \
-w /work \
'${{ inputs.apko-image }}' \
build \
--arch=x86_64 \
--sbom=false \
wolfi-act.apko.config.yaml \
wolfi-act:latest \
wolfi-act.tar
else
docker run --rm \
-v ${PWD}:/work \
-w /work \
'${{ inputs.apko-image }}' \
build \
--arch=x86_64 \
--sbom=false \
wolfi-act.apko.config.yaml \
wolfi-act:latest \
wolfi-act.tar 2>/dev/null
fi
eval docker run --rm \
-v ${PWD}:/work \
-w /work \
'${{ inputs.apko-image }}' \
build \
--arch=x86_64 \
--sbom=false \
wolfi-act.apko.config.yaml \
wolfi-act:latest \
wolfi-act.tar "${debug_args}"
echo "done."
printf "[πŸ™] Loading ephemeral container image into Docker... "
Expand All @@ -93,18 +85,9 @@ runs:
echo "[πŸ™] Running the following command in ephemeral container image:"
echo '${{ inputs.command }}'
echo "[πŸ™] Output:"
if [[ "${debug}" == "true" ]]; then
docker run -i --rm --platform linux/amd64 \
-v ${PWD}:/work \
-w /work \
--env-file wolfi-act.github.env \
wolfi-act:latest-amd64 \
bash -exc '${{ inputs.command }}'
else
docker run -i --rm --platform linux/amd64 \
-v ${PWD}:/work \
-w /work \
--env-file wolfi-act.github.env \
wolfi-act:latest-amd64 \
bash -ec '${{ inputs.command }}'
fi
eval docker run -i --rm --platform linux/amd64 \
-v ${PWD}:/work \
-w /work \
--env-file wolfi-act.github.env \
wolfi-act:latest-amd64 \
bash "${debug_args_image}" '${{ inputs.command }}'

0 comments on commit e7e354d

Please sign in to comment.