File tree Expand file tree Collapse file tree 5 files changed +65
-3
lines changed Expand file tree Collapse file tree 5 files changed +65
-3
lines changed Original file line number Diff line number Diff line change 1+ name : Start Redis server with Authentication
2+
3+ on : [push, pull_request]
4+
5+ jobs :
6+ redis-action :
7+ runs-on : ubuntu-latest
8+ strategy :
9+ matrix :
10+ redis-version : [4, 5, 6]
11+
12+ name : Start Redis Server v${{ matrix.redis-version }}
13+ steps :
14+ - name : Checkout
15+ uses : actions/checkout@v1
16+
17+ - name : Start Redis Server
18+ uses : ./
19+ with :
20+ redis-version : ${{ matrix.redis-version }}
21+ redis-password : password
Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## [ 1.7.0] ( https://github.com/supercharge/redis-github-action/compare/v1.6.0...v1.7.0 ) - 2023-08-12
4+
5+ ### Added
6+ - add ` redis-password ` for start Redis with Authentication
7+
8+ ### Updated
9+ - update versions in README
310
411## [ 1.6.0] ( https://github.com/supercharge/redis-github-action/compare/v1.5.0...v1.6.0 ) - 2023-07-27
512
Original file line number Diff line number Diff line change @@ -170,6 +170,30 @@ jobs:
170170 - name: …
171171` ` `
172172
173+ # ## Using Authentication
174+ Starting in v1.7.0, You can start the Redis with Authentication using the `redis-password` input :
175+
176+ ` ` ` yaml
177+ name: Run tests
178+
179+ on: [push]
180+
181+ jobs:
182+ build:
183+ runs-on: ubuntu-latest
184+ strategy:
185+ matrix:
186+ redis-version: [6, 7]
187+
188+ steps:
189+ - name: Start Redis
190+ uses: supercharge/[email protected] 191+ with:
192+ redis-version: ${{ matrix.redis-version }}
193+ redis-password: 'password'
194+
195+ - name: …
196+ ` ` `
173197
174198# # License
175199MIT © [Supercharge](https://superchargejs.com)
Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ inputs:
1818 description : ' Redis port to use and expose'
1919 required : false
2020 default : 6379
21+ redis-password :
22+ description : " Redis password to use"
23+ required : false
24+ default : ' '
2125 redis-container-name :
2226 description : " Name of the created container. Useful if you run multiple Redis containers"
2327 required : false
3539 - ${{ inputs.redis-image }}
3640 - ${{ inputs.redis-version }}
3741 - ${{ inputs.redis-port }}
42+ - ${{ inputs.redis-password }}
3843 - ${{ inputs.redis-container-name }}
3944 - ${{ inputs.redis-remove-container }}
Original file line number Diff line number Diff line change 33REDIS_IMAGE=$1
44REDIS_VERSION=$2
55REDIS_PORT=$3
6- REDIS_CONTAINER_NAME=$4
7- REDIS_REMOVE_CONTAINER=$5
6+ REDIS_PASSWORD=$4
7+ REDIS_CONTAINER_NAME=$5
8+ REDIS_REMOVE_CONTAINER=$6
89
910if [ -z " $REDIS_VERSION " ]; then
1011 echo " Missing Redis version in the [redis-version] input. Received value: $REDIS_VERSION "
1415
1516DOCKER_RUN_ARGS=" --name $REDIS_CONTAINER_NAME --publish $REDIS_PORT :6379 --detach $REDIS_IMAGE :$REDIS_VERSION "
1617
18+ if [ -n " $REDIS_PASSWORD " ] ; then
19+ DOCKER_RUN_ARGS=" $DOCKER_RUN_ARGS redis-server --requirepass $REDIS_PASSWORD "
20+ fi
21+
1722if [ " $REDIS_REMOVE_CONTAINER " == " true" ] ; then
18- DOCKER_RUN_ARGS+= " --rm"
23+ DOCKER_RUN_ARGS= " $DOCKER_RUN_ARGS --rm"
1924fi
2025
2126echo " Starting single-node Redis instance: $DOCKER_RUN_ARGS "
You can’t perform that action at this time.
0 commit comments