Integrating Hava with GitHub using Actions

Hava has published an Action to make it easier to integrate Hava with a CI/CD pipeline. It allows you trigger a synchronization of one of your sources as part of your workflow execution, and optionally export a PNG image of the updated environment that can be committed to your documents folder to keep it up to date and in sync with your code changes.

The latest version of hava-sync-action can be found on the GitHub marketplace.


To use the action as part of your workflow, you need to create a step in your job like below

    runs-on: ubuntu-latest

      - uses: teamhava/hava-sync-action@v1
          source_id: ${{ secrets.HAVA_SOURCE_ID }}
          hava_token: ${{ secrets.HAVA_API_TOKEN }}
          environment_id: ${{ secrets.HAVA_ENV_ID }}
          view_type: "infrastructure"

This is a minimal setup for the action, details on all the settings can be found in the marketplace listing and our public github repository.

You can also see an implementation of the action in our public example repository.

Getting Configuration Values

The action requires a few configuration values that you need to know before you implement this in your own repository: The ID of the source you are synchronizing, the ID of the environment you are exporting an image of, and a token to access the Hava API

Hava API Token

To generate a new API token, follow the guide in our developer documentation.

Source ID

There are two main ways to get the ID of a source, you can either use the API to get a list of all sources and their ID, or you can use the search bar in the Hava app

Using the API

The Hava API has a /source endpoint that can be accessed on to get the list. See our API documentation for more detail

Using the App UI

When you search using the source: key in the Hava application it will list all the available options for you like in the below screenshot. Select the source you are looking for and the ID will be added to the search query. You can now copy this and use it in your workflow

Environment ID

The environment ID is available as part of the URL when you click on an environment in the Hava application. Copy the the portion of the URL that is highlighted below, it's a UUID.

Last updated