From 3adf431074b7ce65771ecd8e63f5d101b5ebdcdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20P=C3=B6hls?= Date: Tue, 28 Dec 2021 06:55:29 +0100 Subject: [PATCH] add container name option --- action.yml | 5 +++++ start-redis.sh | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index c6dae87..b93667c 100644 --- a/action.yml +++ b/action.yml @@ -14,6 +14,10 @@ inputs: description: 'Redis port to use and expose' required: false default: 6379 + redis-container-name: + description: "Name of the created container. Useful if you run multiple Redis containers" + required: false + default: 'redis' runs: using: 'docker' @@ -21,3 +25,4 @@ runs: args: - ${{ inputs.redis-version }} - ${{ inputs.redis-port }} + - ${{ inputs.redis-container-name }} diff --git a/start-redis.sh b/start-redis.sh index cd9e385..92f0822 100644 --- a/start-redis.sh +++ b/start-redis.sh @@ -2,6 +2,7 @@ REDIS_VERSION=$1 REDIS_PORT=$2 +REDIS_CONTAINER_NAME=$3 if [ -z "$REDIS_VERSION" ]; then echo "Missing Redis version in the [redis-version] input. Received value: $REDIS_VERSION" @@ -10,4 +11,4 @@ if [ -z "$REDIS_VERSION" ]; then fi echo "Starting single-node Redis instance" -docker run --name redis --publish $REDIS_PORT:6379 --detach redis:$REDIS_VERSION +docker run --name $REDIS_CONTAINER_NAME --publish $REDIS_PORT:6379 --detach redis:$REDIS_VERSION