This commit is contained in:
parent
f63602e5f4
commit
e30de98e6a
3 changed files with 10 additions and 6 deletions
|
@ -21,7 +21,7 @@ jobs:
|
|||
image: debian:11-slim
|
||||
volumes: /tmp/:/tmp/
|
||||
options: -e TESTENV=${{ gitea.workspace }}
|
||||
run: echo "test"
|
||||
run: env; echo "test"
|
||||
|
||||
- name: multi-line options
|
||||
uses: https://git.44net.ch/actions/docker-run-action@main
|
||||
|
@ -35,5 +35,6 @@ jobs:
|
|||
-e TESTENV=${{ gitea.workspace }}
|
||||
-e TESTENV2=TESTENV2
|
||||
run: >-
|
||||
env;
|
||||
sh -c
|
||||
echo "test
|
||||
echo "test"
|
||||
|
|
|
@ -28,10 +28,9 @@ inputs:
|
|||
description: "Command(s) to run in the container"
|
||||
required: false
|
||||
|
||||
shell:
|
||||
description: "Shell to use"
|
||||
entrypoint:
|
||||
description: "Entrypoint for the container"
|
||||
required: false
|
||||
default: sh
|
||||
|
||||
registry:
|
||||
description: "Container registry URL"
|
||||
|
|
|
@ -28,6 +28,11 @@ if [ "${INPUT_MOUNT_SOCKET,,}" == "true" ]; then
|
|||
RUNTIME_OPTIONS+=(--volume "/var/run/docker.sock:/var/run/docker.sock")
|
||||
fi
|
||||
|
||||
# set entrypoint
|
||||
if [ "${INPUT_ENTRYPOINT,,}" == "true" ]; then
|
||||
RUNTIME_OPTIONS+=(--entrypoint="${INPUT_ENTRYPOINT}")
|
||||
fi
|
||||
|
||||
# map volumes
|
||||
mapfile -t -d ' ' TMP_VOLUMES < <(printf -- '%s' "${INPUT_VOLUMES}")
|
||||
for vol in "${TMP_VOLUMES[@]}"; do
|
||||
|
@ -49,7 +54,6 @@ done
|
|||
exec docker run \
|
||||
--volume "${INPUT_WORKDIR}:${INPUT_WORKDIR}" \
|
||||
--workdir "${INPUT_WORKDIR}" \
|
||||
--entrypoint="${INPUT_SHELL}" \
|
||||
--env-file "/docker-run-action.env" \
|
||||
"${RUNTIME_OPTIONS[@]}" \
|
||||
"${CUSTOM_OPTIONS[@]}" \
|
||||
|
|
Reference in a new issue