diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 66589bc..ff552af 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,7 +3,7 @@ name: Docker Run Action Tests on: push: branches: - - main + - '**' pull_request: jobs: diff --git a/README.md b/README.md index 8bdac31..15682c8 100644 --- a/README.md +++ b/README.md @@ -55,4 +55,4 @@ run: | echo "first line" echo "second line" -``` + diff --git a/action.yml b/action.yml index 7c1a8e6..ed8cba2 100644 --- a/action.yml +++ b/action.yml @@ -15,6 +15,10 @@ inputs: description: 'Use a specific shell' required: false default: sh + script_prefix: + description: 'a prefix telling the shell to execute the following (single) string as a script' + required: false + default: -c registry: description: 'Registry' required: false diff --git a/entrypoint.sh b/entrypoint.sh index 39c1d70..020396a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -8,4 +8,4 @@ if [ ! -z $INPUT_DOCKER_NETWORK ]; then INPUT_OPTIONS="$INPUT_OPTIONS --network $INPUT_DOCKER_NETWORK" fi -exec docker run -v "/var/run/docker.sock":"/var/run/docker.sock" $INPUT_OPTIONS --entrypoint=$INPUT_SHELL $INPUT_IMAGE -c "${INPUT_RUN//$'\n'/;}" +exec docker run -v "/var/run/docker.sock":"/var/run/docker.sock" $INPUT_OPTIONS $INPUT_IMAGE $INPUT_SHELL $INPUT_SCRIPT_PREFIX "${INPUT_RUN//$'\n'/;}"