From 4b3e16a4676a188c37ae220f8a8dc6a95ae848ec Mon Sep 17 00:00:00 2001 From: Sambo Chea Date: Fri, 26 Mar 2021 21:42:12 +0700 Subject: [PATCH] Fixed docker image and commands and add 0.9 --- .github/workflows/main.yml | 2 +- README.md | 4 ++-- entrypoint.sh | 11 +++++++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5c03f61..2a0bb85 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,7 @@ jobs: steps: - name: Starter Docker Test - uses: cubetiq/starter-docker-actions@v0.8 + uses: cubetiq/starter-docker-actions@v0.9 with: shell: bash run: docker version diff --git a/README.md b/README.md index 7b3c4de..d0e32a9 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ ```yaml - name: Starter Docker - uses: CUBETIQ/starter-docker-actions@v0.8 + uses: CUBETIQ/starter-docker-actions@v0.9 ``` # Example Action @@ -27,7 +27,7 @@ jobs: steps: - name: Starter Docker Test - uses: cubetiq/starter-docker-actions@v0.8 + uses: cubetiq/starter-docker-actions@v0.9 with: shell: bash run: docker version diff --git a/entrypoint.sh b/entrypoint.sh index fe3efaf..ec21839 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -11,11 +11,18 @@ then INPUT_OPTIONS="$INPUT_OPTIONS --network $INPUT_DOCKER_NETWORK" fi if [ -z $INPUT_SHELL ]; -then INPUT_IMAGE=bash +then INPUT_SHELL=bash fi +if [ -z $INPUT_IMAGE ]; +then INPUT_IMAGE=docker +fi + +echo "Shell: $INPUT_SHELL" +echo "Image: $INPUT_IMAGE" + if [ -z $semicolon_delimited_script ]; then semicolon_delimited_script="echo $(whoami)" fi -exec docker run -v "/var/run/docker.sock":"/var/run/docker.sock" $INPUT_OPTIONS --entrypoint=$INPUT_SHELL $INPUT_IMAGE \ No newline at end of file +exec docker run -v "/var/run/docker.sock":"/var/run/docker.sock" $INPUT_OPTIONS --entrypoint=$INPUT_SHELL $INPUT_IMAGE -c "`cat semicolon_delimited_script`" \ No newline at end of file