Checks for changes to local hasura metadata and migration files. This workflow would run on your main
/ default branch and detect changes.
You could then run hasura migrate apply
or hasura metadata apply
conditionally based on these changes.
- Install
act
: https://nektosact.com/installation/index.html - Place the workflow in the appropriate place in your project under `.github/workflows/hasura-changes-since-release.yml
- Grab a Github Personal Access Token (PAT) for your repository.
- Run the command:
act -s GITHUB_TOKEN -W '.github/workflows/hasura-changes-since-release.tf'
- You'll be prompted to provide your PAT. Enter/paste that and ENTER.
- Profit 💰
Output should look something like:
| Migration changes are:
| Metadata changes are: foo/bar/metadata/databases/baz/foobar/foobaz.yaml
The act
tool can be finicky. There are sometimes issues with paths-filter
and git version as well. That's why you see git version 2.44 pinned.
It would be worthwile to build a base image with all of the dependencies and git installed from source, which would make it run much more quickly!
You'll notice if: ${{ env.ACT }}
on some steps which means they will only fire if you are running the action locally via act
.
If running on Mac ARM architecture you may want to disable Rosetta in Docker Desktop settings.