diff --git a/README.md b/README.md index eab5a93..0d29813 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ password: ${{ secrets.DOCKER_PASSWORD }} registry: gcr.io image: private-image:latest - options: -v ${{ github.workspace }}:/work -e ABC=123 + options: -e ABC=123 run: | echo "Running Script" /work/run-script diff --git a/action.yml b/action.yml index 7c1a8e6..c348541 100644 --- a/action.yml +++ b/action.yml @@ -8,6 +8,10 @@ inputs: options: description: 'Options' required: false + workdir: + description: 'Workdir for the container' + required: false + default: /github/workspace/${{ github.event.repository.name }} run: description: 'Run command in container' required: false diff --git a/entrypoint.sh b/entrypoint.sh index 39c1d70..dd1ea64 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 --workdir "$INPUT_WORKDIR" -v "/var/run/docker.sock:/var/run/docker.sock" -v "$RUNNER_WORKSPACE:/github/workspace" $INPUT_OPTIONS --entrypoint=$INPUT_SHELL $INPUT_IMAGE -c "${INPUT_RUN//$'\n'/;}"