Github Integration

📘

Note

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

New Template

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

  1. Click ADD A NEW TEMPLATE on the top left in the Templates screen.
  2. Pick your template type, pick a name for the template, and then click on NEXT
  3. Click on the GitHub.com button. Since you have already created a GitHub template in this env0 organization, no such popup will appear, you are now able to pick from repositories known to env0 in your organization
  4. Pick the repository containing your terraform configuration.
  5. If you would like to pull the code from a specific revision or branch, enter that in the Revision field. Leaving this field empty will use your default branch, which is usually “master”/"main".
  6. Enter the folder your Terraform files are located in under Terraform Folder. If your Terraform files are in the root of the repository, leave this empty.
  7. Click on NEXT to proceed to the variables section
  8. Add environment and terraform variables that you'd like to be used during deployment, and then click on NEXT to go to the final "Projects" section
  9. Pick the projects that you'd like to have access to deploy this template, and then click on DONE to create the template.

🚧

Troubleshooting

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

    • GitHub App is not installed - Simply click on the "add another organization" link underneath 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 you 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), and then "Save" your changes.
  • 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 did not have permissions to install the GitHub App, and instead you have sent a request to another user to install the App. Please cancel that request in GitHub, and ask a different user that has permissions to install the GitHub App to 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
Edit GitHub App SettingsEdit GitHub App Settings

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 the VCS step. From there you can click on the GitHub.com button, and integrate with GitHub as you would for a new template.

Did this page help you?