diff --git a/README.md b/README.md index 5f7cd0f..af6c6d2 100644 --- a/README.md +++ b/README.md @@ -146,8 +146,8 @@ jobs: ``` -### Remove container when exit -Starting in v1.6.0, when running this action on a self-hosted runner, it’s helpful to remove the container so its name won’t conflict: +### Using Authentication +Starting in v1.7.0, You can start the Redis with Authentication using the `redis-password` input: ```yaml name: Run tests @@ -166,14 +166,14 @@ jobs: uses: supercharge/redis-github-action@1.8.1 with: redis-version: ${{ matrix.redis-version }} - redis-remove-container: true # false by default + redis-password: 'password' - name: … ``` -### Using Authentication -Starting in v1.7.0, You can start the Redis with Authentication using the `redis-password` input: +### Remove Docker Container on Exit +Starting in v1.9.0, when running this action on a self-hosted runner, it’s helpful to remove the container so its name won’t conflict: ```yaml name: Run tests @@ -189,10 +189,10 @@ jobs: steps: - name: Start Redis - uses: supercharge/redis-github-action@1.8.1 + uses: supercharge/redis-github-action@1.7.0 with: redis-version: ${{ matrix.redis-version }} - redis-password: 'password' + redis-remove-container-on-exit: true # false by default - name: … ``` diff --git a/action.yml b/action.yml index 5778881..9dd3641 100644 --- a/action.yml +++ b/action.yml @@ -17,7 +17,7 @@ inputs: redis-port: description: 'Redis port to use and expose' required: false - default: 6379 + default: "6379" redis-password: description: "Redis password to use" required: false @@ -26,11 +26,11 @@ inputs: description: "Name of the created container. Useful if you run multiple Redis containers" required: false default: 'redis' - redis-remove-container: + redis-remove-container-on-exit: description: "Remove container after container exit?" required: false type: boolean - default: false + default: "false" runs: using: 'docker' @@ -41,4 +41,4 @@ runs: - ${{ inputs.redis-port }} - ${{ inputs.redis-password }} - ${{ inputs.redis-container-name }} - - ${{ inputs.redis-remove-container }} + - ${{ inputs.redis-remove-container-on-exit }} diff --git a/start-redis.sh b/start-redis.sh index 907ed3a..2a5a285 100755 --- a/start-redis.sh +++ b/start-redis.sh @@ -5,7 +5,7 @@ REDIS_VERSION=$2 REDIS_PORT=$3 REDIS_PASSWORD=$4 REDIS_CONTAINER_NAME=$5 -REDIS_REMOVE_CONTAINER=$6 +REDIS_REMOVE_CONTAINER_ON_EXIT=$6 # 🛡️ Default version fallback if [ -z "$REDIS_VERSION" ]; then @@ -18,7 +18,7 @@ fi DOCKER_RUN_ARGS="--name $REDIS_CONTAINER_NAME --publish $REDIS_PORT:6379 --detach" # 🗑️ If remove flag is true, run container with --rm (auto-remove on exit) -if [ "$REDIS_REMOVE_CONTAINER" = "true" ]; then +if [ "$REDIS_REMOVE_CONTAINER_ON_EXIT" = "true" ]; then DOCKER_RUN_ARGS="--rm $DOCKER_RUN_ARGS" fi