Skip to main content

How to integrate GitHub account?

This guide provides two authentication methods to integrate your GitHub account:

  1. Personal Access Token (PAT) Flow
  2. GitHub App Credentials Flow

Personal Access Token (PAT) Flow

Overview

To authenticate, you need:

  • Personal Access Token (PAT)

Step 1: Generate Personal Access Token

  1. Navigate to GitHub.com and sign in to your account.
  2. Click your profile photo in the upper-right corner, then select Settings from the dropdown menu.
GitHub Settings page
  1. In the left sidebar, scroll down and click Developer settings.
GitHub Developer Settings
  1. Under Personal access tokens, click Tokens (classic).
GitHub Personal Access Tokens
  1. Select Tokens(classic), then select Generate new token.
Generate GitHub Token
  1. Configure Token Settings:

    • Note: Enter a descriptive name (e.g., “Project Integration API”).
    • Expiration: Choose a valid expiration period.
      Recommended: 90 days or less (avoid “No expiration”).
  2. Select Required Scopes:

    • repo – Full repository access
    • admin:repo_hook – Repository webhook management
    • admin:org_hook – Organization webhook management
    • read:user – Read user profile data
    • user:email – Access user email addresses
Set GitHub Token Permissions
  1. Click Generate token.
    Copy the token immediately — it won’t be shown again. Store it securely for use in Unizo integration setup.
Generated GitHub Token

GitHub App Credentials Flow

Overview

To authenticate your GitHub App , collect the following details after app registration:

  • App Name
  • App URL
  • App ID
  • Client ID
  • PEM File (Private Key)
  • Redirect URL

Step 1: Create a GitHub App

  1. Go to GitHub.com and sign in to your account.
  2. In the upper-right corner, click your profile photo, then select Settings.
GitHub Settings page
  1. In the left sidebar, click Developer settings.
GitHub Developer Settings
  1. Click New GitHub App.
Create New GitHub App
  1. Under Register new GitHub App, provide the following details:

    • GitHub App name: Display name of your app as shown to users.
    • Homepage URL: The main website or landing page associated with your app.
    • Callback URL Or Redirect URL: Use
      https://api.unizo.ai/cb/v1/github_app/callback
      (Required when testing from Unizo.)
    • Check Request user authorization (OAuth) during installation.
    • Uncheck Webhook Active.
    Register GitHub App
  2. Configure Permissions as follows:

    • metadata → read
    • pull_requests → write
    • secrets → write
    • workflows → write
    • members → read
    • checks → write
    • contents → read
    • events → read
    • webhooks → write
  3. Select Any account, then click Create GitHub App.

GitHub App Permissions

Step 2: Retrieve GitHub App Credentials

After creating the app, click on the GitHub App you registered and collect the following details:

  • App URL → In the About section under Public link.
  • App ID → Displayed in the About section.
  • Client ID → Displayed in the About section.
  • App Name → Found in Basic Information.
  • PEM File → Go to Private keys → click Generate a private key to download the .pem file.
    Store it securely — it is your private key and must remain confidential.
GitHub App Details