How to register a GitHub Enterprise repository

GitHub Enterprise is supported, and you can have the same features as with GitHub.com with two exceptions:

  1. You can’t use the automatic options during the Add New App process, you’ll have to manually specify the git clone URL, register the SSH key and the Webhook.
  2. Build status won’t be sent back to your server, so no build status indicator will be presented on the pull requests.

Setup

  1. Start the Add New App process
  2. At the first step (Connect your repository) select the Other / Manual option, and copy paste the SSH URL of the repository
  3. In the Setup repository access section copy the SSH key generated by Bitrise.io from the textfield and register it on your GitHub Enterprise account (most likely it’s enough to register it as a Repository Deploy key, but you’re free to register it for a user account too, e.g. to a “CI” user who has access to the repository / repositories you want to use on bitrise.io)
  4. Continue the process, just like you would in any other case

Once the registration is complete you can start builds manually.

To start builds automatically you have to register a Webhook.

  1. Go to the Code tab of the app on bitrise.io
  2. in the WEBHOOKS section select the GitHub option in the dropdown. This will generate a webhook URL for you in the format https://hooks.bitrise.io/h/github/....
  3. Register this webhook on your GitHub Enterprise as a webhook for the repository, and enable the Push and Pull request events for the webhook.

That’s all, once the webhook is registered your next code push will start a build on bitrise.io

If you’d have any questions just let us know!

Is the feature planned, or is there any workaround in the meantime?

Definitely planned, please vote & comment here, on the related Feature Request: GitHub Enterprise - Commit/PR Status API support

@jcayzac Ohh, forgot to mention that there is a workaround for sending statuses back to GitHub Enterprise, you can use the GitHub Status step.

This can send the proper success/failed status back to your self hosted GitHub Enterprise, except in the case when the build would be aborted before this step would run, as this is a regular build step.
Just drop it to the end of the Workflow and fill out the required params (e.g. access token), that’s all :slight_smile:

1 Like

Hi, @viktorbenei

In order to clone Github Enterprise code,
I think that it is necessary to allow communication from Bitrise to Github Enterprise.
(Since Github Enterprise is basically behind the firewall)

Is there a way to securely connect Bitrise and Github Enterprise?

If simply allow it with source IP, I think that any user of Bitrise will have access to Github Enterprise.

1 Like

@justice3120 that depends on your own infra / servers. VPN might be a suitable solution:

@viktorbenei
Thanks!
I will consider it in the direction of using VPN.

1 Like

@viktorbenei the workaround for PR integration is ok, however having this more integrated into Bitrise would be ideal. The status doesn’t get updated immediately when a build is queued up. Also, if the build is in an inactive state then the PR doesn’t get updated to reflect that.

I would really love to see this more integrated since many larger organizations use Github Enterprise.

1 Like

Definitely planned @marioharper - please vote & comment on the related #feature-request : GitHub Enterprise - Commit/PR Status API support

Hi Vik,

Was trying to configure Github Status step.
The problem is that, in Account settings, when I enable Github, it is connecting to GitHub but not to Github enterprise account. Due to which, it is not able to connect to repo hosted in Github Enterprise and update the build status. Could you assist, how I can connect to Github Enterprise account instead of Github in Account Settings. Please note that I’m not referring to GitHub enterprise connectivity… I have done the configuration and I’m able to clone my github enterprise repo and run the workflow. My goal is sending the build status back to the Pull request of the repo hosted in Github Enterprise.

Hi @sowjanya-gurajada-Mi!

As we started discussing this in the other thread, you can not connect your GitHub Enterprise account the same way you could your regular GitHub account. The main reason for this being the difference in the nature of these services - the former one is online and we can easily access the information while the latter one is self-hosted and usually on a restricted network.

@viktorbenei is mentioning the GitHub Status step, exactly, because that would allow you to send back build status to your git repo.

One thing that I would add for this thread to be complete and up-to-date is about hosting the bitrise.yml file on the repository. It is supported for GitHub Enterprise in the Cloud but not for self-hosted GitHub Enterprise.

In the latter case, there is a workaround which is to use the Bitrise CLI to run workflows.

Good news! We just released a dedicated integration for customers using self-hosted GitHub Enterprise Server (GHES). This will allow you to host your bitrise.yml file on the repository. More improvements are coming e.g. sending build status to GHES

1 Like