diff --git a/README.md b/README.md index 54eea8f..5189d75 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# MySQL GitHub Action [![Test status](https://github.com/mirromutth/mysql-action/workflows/test/badge.svg)](https://github.com/mirromutth/mysql-action/actions) +# MySQL GitHub Action [![Test status](https://github.com/mirromutth/mysql-action/workflows/test/badge.svg)](https://github.com/stronk7/mysql-action/actions) This [GitHub Action](https://github.com/features/actions) sets up a MySQL database in Docker. @@ -23,6 +23,10 @@ steps: mysql password: ${{ secrets.DatabasePassword }} # Required if "mysql user" exists. The password for the "mysql user" use tmpfs: true # Optional, default value is false. Mounts /var/lib/mysql to tmpfs (i.e. in RAM) for increased performance tmpfs size: '2048M' # Optional, default value is '1024M'. Desired size of above-mentioned tmpfs volume + extra conf: | # Optional, default is ''. Other configuration options to be added on startup. + --max_allowed_packet=16MB + --skip-log-bin + ... ``` If want bind MySQL host port to 3306, please see [The Default MySQL](#the-default-mysql). diff --git a/action.yml b/action.yml index f733c68..ab2dd5d 100644 --- a/action.yml +++ b/action.yml @@ -49,6 +49,10 @@ inputs: description: "Desired size of tmpfs volume" required: false default: "1024M" + extra conf: + description: "Other configuration options, to be added to the startup (--max_allowed_packet=16MB --skip-log-bin ...)" + required: false + default: '' runs: using: 'docker' image: 'Dockerfile' diff --git a/entrypoint.sh b/entrypoint.sh index 09c27e4..9c21ccf 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -33,4 +33,11 @@ fi docker_run="$docker_run -d -p $INPUT_HOST_PORT:$INPUT_CONTAINER_PORT mysql:$INPUT_MYSQL_VERSION --port=$INPUT_CONTAINER_PORT" docker_run="$docker_run --character-set-server=$INPUT_CHARACTER_SET_SERVER --collation-server=$INPUT_COLLATION_SERVER" +if [ -n "$INPUT_EXTRA_CONF" ]; then + INPUT_EXTRA_CONF=$(echo $INPUT_EXTRA_CONF | xargs) + echo "Other startup extra configuration: $INPUT_EXTRA_CONF" + + docker_run="$docker_run $INPUT_EXTRA_CONF" +fi + sh -c "$docker_run"