Skip to main content

Set Up GitHub Connector (OAuth or PAT)

Authenticate your agent to github.com using OAuth or a Personal Access Token. GitHub repository authentication lives on the Builder -> Code Access page — it is not offered in the Builder -> Connectors add-connector wizard.

What you'll build

An authenticated GitHub connection so your agent can search code, manage issues, pull requests, and trigger workflows — depending on the permissions you grant. Learn more → GitHub Connector.

Prerequisites​

  • An active agent in Running state
  • Access to github.com repositories you want the agent to use
  • Agent role: Administrator or Standard User

Step 1: Open GitHub authentication​

For an existing agent, navigate to Builder -> Code Access and click Add repository. The Add repositories dialog opens on the Connection step.

Code Access Configuration page with GitHub selected and the Add repository button
Not in the Connectors wizard

The Builder -> Connectors add-connector wizard does not list a GitHub OAuth card — repository authentication was intentionally moved to Code Access. The GitHub MCP server card you may see in that wizard is a different integration (the remote MCP endpoint at api.githubcopilot.com/mcp/) and accepts only a bearer token / PAT, not OAuth.

Step 2: Choose authentication​

  1. Select GitHub as the platform.
  2. Enter the full URL of a repository you can access.
  3. Choose one authentication method:
MethodWhen to use
OAuthInteractive setup for user-driven access. Preferred where available — no token to rotate.
PATService account or non-interactive setup. Note that EMU / internally managed GitHub accounts cap PAT lifetime (often days), so OAuth avoids frequent rotation.
BYO GitHub AppEnterprise governance, or any *.ghe.com host (where it is the only supported method).
OAuth option not shown

The OAuth choice appears only when a GitHub OAuth application is configured for your environment, and never for GitHub Enterprise Cloud (*.ghe.com) hosts, which require the BYO GitHub App method. If you see only PAT and BYO GitHub App, contact your administrator.

OAuth flow​

  1. Select OAuth.
  2. Click Sign in to GitHub.
  3. Complete the GitHub popup authorization.
  4. Confirm status shows Connected.

PAT flow​

  1. Select PAT.
  2. Paste a GitHub token with required scopes.
  3. Click Connect.
  4. Confirm status shows Connected.

Step 3: Add repositories and save​

  1. Click Next to open the Add repositories step.
  2. Select the repositories to add. You can add multiple rows.
  3. Click Save.

The repositories now appear on the Code Access page under their GitHub connection.

Step 4: Confirm runtime operations​

After saving the repositories, test with a chat prompt such as:

List recent issues from owner/repo and summarize the top 3 risks.

If your environment enables PR actions, you can also test a PR-related prompt.

Use a direct verification prompt as a final checkpoint:

Get me recent issues from owner/repo.

Required permissions by operation​

OperationOAuth/PAT minimum
Read repository metadata/contentrepo for private repos (public_repo for public-only)
List or create issuesissue-capable repo access
Pull request operationsPR-capable repo access

Troubleshooting​

SymptomLikely causeFix
GitHub connection shows disconnectedToken expired or revokedRe-authenticate OAuth or rotate PAT
Issue reads work, PR actions failMissing PR permissionGrant PR permission and retry
Connector cannot access private reposToken scope too narrowUse repo scope for private repos
Popup does not openBrowser popup blockedAllow popups for the portal domain
ResourceWhat you'll learn
GitHub ConnectorPath selection and auth matrix
Set Up GitHub BYO App ConnectorApp-based auth for enterprise governance
Connect Source CodeCode Access path for repository indexing
Set Up MCP ConnectorGitHub MCP path
Connect GitHub Enterprise CloudBYO App path for *.ghe.com
Was this page helpful?