Skip to content

Commit

Permalink
Fix creds
Browse files Browse the repository at this point in the history
  • Loading branch information
kobi-lemberg committed Mar 19, 2020
1 parent 9c793ce commit 5a04b3a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 23 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ Examples:

```$xslt
name: Run tests
uses: matankdr/[email protected]CREDS2
uses: matankdr/[email protected]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/[email protected]CREDS2
uses: matankdr/[email protected]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
```
11 changes: 6 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
Expand Down
19 changes: 7 additions & 12 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 5a04b3a

Please sign in to comment.