File tree 5 files changed +65
-3
lines changed 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 1
1
# Changelog
2
2
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
3
10
4
11
## [ 1.6.0] ( https://github.com/supercharge/redis-github-action/compare/v1.5.0...v1.6.0 ) - 2023-07-27
5
12
Original file line number Diff line number Diff line change @@ -170,6 +170,30 @@ jobs:
170
170
- name: …
171
171
` ` `
172
172
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
+ ` ` `
173
197
174
198
# # License
175
199
MIT © [Supercharge](https://superchargejs.com)
Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ inputs:
18
18
description : ' Redis port to use and expose'
19
19
required : false
20
20
default : 6379
21
+ redis-password :
22
+ description : " Redis password to use"
23
+ required : false
24
+ default : ' '
21
25
redis-container-name :
22
26
description : " Name of the created container. Useful if you run multiple Redis containers"
23
27
required : false
35
39
- ${{ inputs.redis-image }}
36
40
- ${{ inputs.redis-version }}
37
41
- ${{ inputs.redis-port }}
42
+ - ${{ inputs.redis-password }}
38
43
- ${{ inputs.redis-container-name }}
39
44
- ${{ inputs.redis-remove-container }}
Original file line number Diff line number Diff line change 3
3
REDIS_IMAGE=$1
4
4
REDIS_VERSION=$2
5
5
REDIS_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
8
9
9
10
if [ -z " $REDIS_VERSION " ]; then
10
11
echo " Missing Redis version in the [redis-version] input. Received value: $REDIS_VERSION "
14
15
15
16
DOCKER_RUN_ARGS=" --name $REDIS_CONTAINER_NAME --publish $REDIS_PORT :6379 --detach $REDIS_IMAGE :$REDIS_VERSION "
16
17
18
+ if [ -n " $REDIS_PASSWORD " ] ; then
19
+ DOCKER_RUN_ARGS=" $DOCKER_RUN_ARGS redis-server --requirepass $REDIS_PASSWORD "
20
+ fi
21
+
17
22
if [ " $REDIS_REMOVE_CONTAINER " == " true" ] ; then
18
- DOCKER_RUN_ARGS+= " --rm"
23
+ DOCKER_RUN_ARGS= " $DOCKER_RUN_ARGS --rm"
19
24
fi
20
25
21
26
echo " Starting single-node Redis instance: $DOCKER_RUN_ARGS "
You can’t perform that action at this time.
0 commit comments