diff --git a/README.md b/README.md index e143d97..91637d7 100644 --- a/README.md +++ b/README.md @@ -5,17 +5,17 @@ Examples: ```$xslt name: Run tests - uses: matankdr/github-docker-sbt@11.0.5-1.3.8-DOCKER-IVY-CREDS2 + uses: matankdr/github-docker-sbt@11.0.5-1.3.8-DOCKER-IVY-CREDS5 with: - packages-resolver: "ivy creds" - command: sbt test + command: sbt test docker:publish publish + packages-resolver: "ivy creds" name: Run test and upload container - uses: matankdr/github-docker-sbt@11.0.5-1.3.8-DOCKER-IVY-CREDS2 + uses: matankdr/github-docker-sbt@11.0.5-1.3.8-DOCKER-IVY-CREDS5 with: + command: sbt test docker:publish publish + packages-resolver: "ivy creds" docker-login-username: "my username" docker-login-password: "my password" docker-registry: "my registry" - packages-resolver: "ivy creds" - command: sbt test docker:publish publish ``` \ No newline at end of file diff --git a/action.yml b/action.yml index db4ab08..468c394 100644 --- a/action.yml +++ b/action.yml @@ -6,6 +6,9 @@ inputs: command: # id of input description: 'Commands to run' required: true + packages-resolver: # packages resolver + description: 'packages resolver' + required: true docker-login-username: # Docker login username description: 'docker login username' required: false @@ -15,18 +18,16 @@ inputs: docker-registry: # Docker registry description: 'docker registry' required: false - packages-resolver: # packages resolver - description: 'packages resolver' - required: false + runs: using: 'docker' image: 'Dockerfile' args: + - ${{ inputs.command }} + - ${{ inputs.packages-resolver }} - ${{ inputs.docker-login-username }} - ${{ inputs.docker-login-password }} - ${{ inputs.docker-registry }} - - ${{ inputs.command }} - - ${{ inputs.packages-resolver }} branding: icon: 'package' diff --git a/entrypoint.sh b/entrypoint.sh index 2accf96..9b727cb 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,20 +1,15 @@ #!/bin/sh set -x -COMMAND="" -IVY_CONF="" -if [[ -z "${1}" || -z "${2}" || -z "${3}" ]]; then - echo "One or more variables are not defined, will run command" - COMMAND = $1 - IVY_CONF = $2 +COMMAND=$1 +IVY_CONF=$2 +if [[ -z "${3}" || -z "${4}" || -z "${5}" ]]; then + echo "One or more variables are not defined, will only run command" else - DOCKER_USERNAME=$1 - DOCKER_PASSWORD=$2 - DOCKER_REGISTRY=$3 - COMMAND=$4 - IVY_CONF=$5 + DOCKER_USERNAME=$3 + DOCKER_PASSWORD=$4 + DOCKER_REGISTRY=$5 echo "Running docker login into ${DOCKER_REGISTRY}" - echo ${DOCKER_PASSWORD} | docker login -u ${DOCKER_USERNAME} --password-stdin ${DOCKER_REGISTRY} fi