For the complete documentation index, see llms.txt. This page is also available as Markdown.

GitHub - Fine-Grained Token

How to integrate GitHub with Fine-Grained Token?

To integrate GitHub with Hivel using a fine-grained token, follow the steps below. This guide ensures a seamless setup, similar to the classic token process but with specific token-based permissions.

Data Access by Hivel

  • Hivel accesses the past 30-90 days of metadata and pull requests from active repositories during the initial sync.

Requirements

  • Ensure to log in with an account possessing write permissions to relevant GitHub repositories.

Best Practice

  1. Opt for a service account rather than an individual-linked account.

  2. Service accounts are typically overseen by the company's admin.

Steps to generate a Fine-Grained Token on GitHub

Quick start: skip the navigation - open the token creation page, then continue from step 4. If the link doesn't take you there, follow from step 1 below.

Step 1:

Log in to GitHub with an account that has write permissions for the repositories you want to integrate.

1. Navigate to Profile icon > Settings

Step 2:

Select Developer Settings at the end.

Step 3:

Select Personal access tokens > Fine-grained tokens.

Step 4:

Click Generate new token.

  1. Give the token name, preferably 'Hivel' and set an Expiration date as needed.

Note: Set the Resource owner dropdown to your organization name, not your personal account. The Organization permissions section (step 4.2.2) only appears when an organization is selected as the resource owner - and a token owned by your personal account cannot access the organization's repositories. If your organization is not listed in the dropdown, an org admin must first allow fine-grained tokens under Organization Settings > Third-party Access > Personal access tokens (see steps 4.4-4.9 below).

2. Under Repository access, choose which repositories Hivel should be able to see:

  • Public repositories - grants read-only access to public repositories.

  • All repositories - grants access to every current and future repository in the organization.

  • Only select repositories - restricts the token to the specific repositories (up to 50) you choose to share with Hivel.

Pick whichever of these three matches your organization's data-sharing policy with Hivel.

Grant the following permissions:

  1. Repository permissions

    1. Contents (read-only)

    2. Metadata (read-only)

    3. Pull Requests (read-only)

  2. Organization permissions

    1. Members (read-only)

3. Click Generate token and copy the token immediately, as you won't be able to view it again.

4. Now go back to the homepage and follow the subsequent steps to allow access to fine-grained token: Navigate to Profile icon > Settings > Organizations.

  1. Select the organizations which need to be integrated.

  1. Go to Repository settings and scroll to the end of the vertical navigation menu.

    7. At the bottom of the navigation menu, select Personal Access Token > Settings.

8. Select Personal access tokens > Fine-grained tokens.

9. On this page, select the option to Allow access via fine-grained personal access tokens.

Step 6: Connect in Hivel

  1. Copy the generated token immediately, as you won't be able to view it again.

  2. Submit the token to Hivel

Hivel validates the token instantly - if the token is wrong, expired, or missing any of the required permissions, Hivel shows a clear message telling you exactly what the problem is. Generate a new token with the correct permissions and reconnect.

That's it, all done!

Last updated