Skip to main content
GitHub Enterprise Server allows you to host GitHub on your own infrastructure, giving you full control over your version control system (VCS). By integrating GHE with env zero, you can leverage all of env zeroโ€™s capabilities, including infrastructure as code (IaC) automation, governance, and cost management, while maintaining a self-hosted and secure environment for your repositories. This integration ensures that teams using GHE can seamlessly manage and automate their cloud infrastructure with env zero, without compromising security or compliance requirements.
NoteGitHub Enterprise is only supported on env zero Organizations signed up for our Self-Hosted Agent.Supported GitHub Enterprise Server versions are:
  • 2.21.13 and above
  • 3.x

GitHub Enterprise Setup

For env zero to be able to clone your code and post back commit statuses when running Plan on Pull Request you need to create and install a personal env zero GitHub App on your organization. This only needs to be done once per GitHub Server.
  1. Create GitHub App
    1. Name your GitHub app env zero
    2. Set Homepage URL to https://env0.com
    3. Skip ahead to the Webhooks section
      • Make sure Active is checked
      • You will now need to set the Webhook URL and Secret.
      • To fetch these, go to the VCS Create Connection.
    4. Skip ahead to the Repository permissions section and grant the following permissions:
      • Checks - Read and write
      • Contents - Read-only
      • Deployments - Read and Write
      • Metadata - Read-only
      • Pull requests - Read and Write
    5. Skip ahead to the Subscribe to events section and check the following:
    6. On โ€œWhere can this GitHub App be installed?โ€ Check โ€œAny account - Allow this GitHub App to be installed by any user or organization.โ€. Note however - currently you may only install the app on a single organization of your choice on your GitHub Enterprise instance
    7. Click โ€œCreate GitHub Appโ€
    8. Make a note of the App ID
    9. Scroll all the way down and โ€œClick the Generate a private keyโ€. A pem file will be downloaded and saved on your computer. Youโ€™ll need it later.
    10. Under the โ€œDisplay informationโ€, click the โ€œUpload a logoโ€ฆโ€ button and upload a logo (Optional)
  2. On the lefthand side menu, click on Install App to install the app on any organization of your choice
    1. Grant env zero access to all or selected repositories in the organization.
    2. Ensure you have granted permission for any organizationโ€™s repository you need access to. If permission is not granted for a specific repository, you may encounter a โ€˜Not Foundโ€™ error at certain points.
  3. Youโ€™ll need the following set as Helm values when installing the env zero agent:
    • githubEnterpriseAppId - The App ID from step 1.8
    • githubEnterpriseAppPrivateKeyEncoded - The content of the pem file downloaded in step 1.9 Please base64 encode it before setting it
    • githubEnterpriseAppInstallationId - (Optional) You can restrict permissions to a single installation ID through this configuration.
NoteIf deploying via Docker, DO NOT base64 encode the following keys:
  • githubEnterpriseAppClientSecretEncoded
  • githubEnterpriseAppPrivateKeyEncoded
Encode to Base64You can open browser Dev Tools - go to console and use
btoa("secret")
to encode the string to base 64On Mac
base64 -i private.pem
values.yml
githubEnterpriseAppId: 111
githubEnterpriseAppPrivateKeyEncoded: aa==
githubEnterpriseAppInstallationId: 222 # Optional 
.env
GITHUB_ENTERPRISE_APP_ID=111
GITHUB_ENTERPRISE_APP_PRIVATE_KEY=aa==

# optional
GITHUB_ENTERPRISE_APP_INSTALLATION_ID=222
  1. Install the agent
Now you can create templates for GitHub Enterprise
โŒ˜I