Configure Octokit for GitHub Enterprise
mainTo use Octokit with a GitHub Enterprise instance, you must configure the api_endpoint.
Interacting with GitHub.com APIs in GitHub Enterprise
Set the api_endpoint to your enterprise hostname's API path (e.g., https://<hostname>/api/v3/).
Interacting with GitHub Enterprise Admin APIs
Use the Octokit::EnterpriseAdminClient for administrator APIs. You can instantiate it directly or configure module-level defaults.
Interacting with the GHES Manage API
Use the Octokit::ManageGHESClient for the GitHub Enterprise Server (GHES) Manage API. This requires a manage_ghes_endpoint (which differs from the standard API endpoint), a manage_ghes_username, and a manage_ghes_password).
# GitHub Enterprise standard API
Octokit.configure do |c|
c.api_endpoint = "https://<hostname>/api/v3/"
end
client = Octokit::Client.new(:access_token => "<your 40 char token>")
# GitHub Enterprise Admin API
admin_client = Octokit::EnterpriseAdminClient.new(
:access_token => "<your 40 char token>",
:api_endpoint => "https://<hostname>/api/v3/"
)
# GHES Manage API
ghes_client = Octokit::ManageGHESClient.new(
:manage_ghes_endpoint => "https://hostname:8443",
:manage_ghes_username => "username",
:manage_ghes_password => "password"
)