Skip to main content
Git v2 is available for GitHub repositories. To have Git v2 turned on for your organization, reach out to Omni support.
In this guide, you’ll turn on Git v2 for an Omni model that is connected to a GitHub repository.

Requirements

To follow the steps in this guide, you’ll need:
  • Connection Admin permissions for the Omni model, which are required to change the model’s git settings
  • A GitHub repository connected to the model with one of these authentication methods:
    • GitHub App
    • HTTPS token. In addition to the permissions in the linked steps, the token needs Commit statuses: Read and write.
  • Permissions in GitHub that allow you to:
    • Add webhooks to the repository

Set up Git v2

1

Open the model's git settings

  1. In Omni, click Develop in the sidebar and open the model.
  2. In the model IDE, click Model > Advanced > Git settings. You can also click the Settings icon in the left navigation, then click Git Settings.
Keep this page open. You’ll copy values from it in the next step.
2

Add the Pull request and Push webhook events

Git v2 needs two events from GitHub:
  • Pull request - Omni runs checks when a pull request is opened or updated, and updates the shared model when a pull request is merged.
  • Push - Omni updates the shared model when someone commits directly to the model’s base branch.
  1. In GitHub, open the repository’s Settings page.
  2. Click Webhooks, located in the Code, planning, and automation section of the sidebar.
  3. If the repository already has a webhook for Omni, click Edit next to it. Otherwise, click Add webhook and fill in the fields as follows:
    • Payload URL - From the Omni Git settings page, copy the Payload URL and paste it into this field.
    • Content type - Select the application/json option.
    • Secret - From the Omni Git settings page, copy the Webhook secret and paste it into this field.
    • SSL verification - Omni recommends leaving SSL verification enabled.
  4. In the Which events would you like to trigger this webhook? section:
    1. Click Let me select individual events.
    2. Select the Pull request and Push events.
  5. Click Add webhook, or Update webhook if you edited an existing one.
3

Turn on Git v2

On the Omni Git settings page, go to the Git integration version section and turn on Use v2 Git integration.The setting applies to one model. If several models share a repository, turn it on for each model.The build and validation checks need an Omni branch for the pull request. To have Omni create a branch for every pull request, turn on Always create branches.
4

Optional: Add a configuration file

To change the severity of a pull request check, add a file at .omni/config.yaml on the repository’s base branch. If the repository doesn’t have the file, Omni runs the checks with these default settings:
.omni/config.yaml
With the default settings, if a sync or validation check fails, Omni warns you in its comment, and the commit status passes.To block merges on a failed check, see Block merges on a failed check. For every setting, see Configuration file.
5

Confirm the setup

Open a pull request that changes a model file. Omni posts a Model: <model_path> commit status and a comment on the pull request.

Next steps