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