Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow give the hasura cli version #9

Merged
merged 1 commit into from
Jun 6, 2021
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
5 changes: 5 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:-./}"

Expand Down