From 412074b195468535568614f845fc428460e43e71 Mon Sep 17 00:00:00 2001 From: Jonathan Bogdanovicz Date: Mon, 17 May 2021 13:47:06 -0300 Subject: [PATCH] feat(docker): Update hasura cli when given version --- README.md | 3 +++ entrypoint.sh | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 5c13c23..0c98b77 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ This Action for [Hasura](https://hasura.io) enables arbitrary actions with the ` - `HASURA_WORKDIR` - **Optional**. The path from the root of your repository to the directory where the `migrations` folder can be found. +- `HASURA_ENGINE_VERSION` - **Optional**. The version of the hasura cli you want to use. (default is `stable`) + ## Example To apply migrations with the Hasura CLI: @@ -39,6 +41,7 @@ jobs: HASURA_ENDPOINT: ${{ secrets.HASURA_ENDPOINT }} HASURA_ADMIN_SECRET: ${{ secrets.HASURA_ADMIN_SECRET }} HASURA_WORKDIR: backend/hasura # replace this by your own path if needed + HASURA_ENGINE_VERSION: v1.3.3 # replace this by the version you need, remove to use stable ``` ## License diff --git a/entrypoint.sh b/entrypoint.sh index db98c71..7a9d33f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -22,6 +22,11 @@ if [ ! -f config.yaml ]; then touch config.yaml fi +if [ -n "$HASURA_ENGINE_VERSION" ]; then + hasura update-cli --version $HASURA_ENGINE_VERSION +fi + + # secrets can be printed, they are protected by Github Actions echo "Executing $command from ${HASURA_WORKDIR:-./}"