GitHub Integration

📘

Note

In order to integrate with GitHub, you need to have permission to install the GitHub App on your GitHub organization/repository. If you do not have these permissions, please ask an admin or an authorized user to create the template

New Template

If you would like to create your first GitHub Integrated Template, please see Create Your First Template instead.

  1. In the top right corner of the Templates screen, click ‘ADD A NEW TEMPLATE’
  2. Pick your template type, name it, and then click ‘NEXT’
  3. Click on the GitHub.com button
  4. Pick the repository containing your IaC configuration
  5. If you would like to pull the code from a specific revision or branch, enter it in the Revision field. Leaving this field empty will use your default branch, which is usually master/main
  6. Under Terraform Folder, enter the folder your Terraform files are located in. If your Terraform files are in the repository’s root, leave this field empty
  7. Click on ‘NEXT’ to proceed to the Variables section
  8. Add the Environment and Terraform variables that you'd like to be used during deployment, then click ‘NEXT’ to go to the final Projects section
  9. Pick the projects that you'd like to have access to deploy this template, then click on ‘DONE’ to create the template
1441

🚧

Troubleshooting

  • Can't find your repository? Check if your GitHub organization has the env0 GitHub App installed and that the App is allowed access to your repository.

    • GitHub App is not installed: Simply click on the ’add another organization’ link in the GitHub Repository field. You will get a popup allowing you to install the env0 GitHub app on another GitHub organization.
    • GitHub App is installed and has access to the repository, but you still can't find your repository: Click on the ‘add another organization’ link and pick your GitHub organization, even though it already has the GitHub App installed. You will now see the env0 GitHub App settings page in GitHub. Edit the repositories that env0 App should have access to (you may also remove and re-pick a repository), then save your changes. Note: You can only do this if you are an organization admin for your GitHub organization.
  • Got the following error: "GitHub App was not installed because you do not have permissions to install our GitHub App on your organization"? This means that you do not have permissions to install the GitHub App, and instead have sent a request to another user to install the App. Please cancel that request in GitHub and ask a different user with permissions to install the GitHub App and create the template for you.

    • A user already accepted your request to install the GitHub App? If so, follow the instructions in the GitHub App is installed and has access to the repository, but you still can't find your repository section above.
1214

Edit GitHub App Settings

Existing Template

If you would like to integrate an existing template with GitHub via a GitHub App:

  1. Go to the Templates screen, and click on ‘Settings’ for the template you would like to integrate with GitHub
  2. Click on ‘VCS’. From there you can click on the ‘GitHub.com’ button, and integrate with GitHub as you would for a new template

Multi-Org Configuration

  1. Click on ‘GitHub.com’ to create a new template
  2. You will get a GitHub popup. Login if you're not already logged in
  3. In the popup, pick the organization you would like to authorize

  1. After selecting the GitHub organization, you will be transferred to the GitHub App settings page for that organization

  1. Here, you need to change something so that the GitHub dialogue will let you save. If ‘Only select repositories’ is already enabled, simply click on ‘All repositories’ and then re-click on ‘Only select repositories.’ You will then be able to save without changing any GitHub App permissions
  2. Upon saving, env0 UI should be able to list the repositories. Once the template is saved, the env0 organization is integrated with GitHub

📝

Additional Content