Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -166,14 +166,14 @@ jobs:
uses: supercharge/[email protected]
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
Expand All @@ -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: …
```
Expand Down
8 changes: 4 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
Expand All @@ -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 }}
4 changes: 2 additions & 2 deletions start-redis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
Loading