Overview
This guide explains how to generate a fine-grained personal access token in GitHub for securely integrating your repository with DeepTraQ or other external systems. Fine-grained tokens provide repository-level permissions, allowing you to grant access only to specific repositories instead of your entire GitHub account.
Using fine-grained tokens improves security by enabling:
- Scoped access to selected repositories
- Controlled permission levels
- Configurable expiration dates
- Safer integrations with third-party platforms
Follow the steps below to generate a secure token for your integration.
Supported Platforms
- GitHub repositories
Prerequisites
- A GitHub account with access to the target repository
- Repository access permissions for the project you want to integrate
- Access to GitHub account settings
Steps
-
Sign in to your GitHub account.
-
Open your profile menu and navigate to Settings.
-
In the left sidebar, go to Developer Settings.
-
Select Personal Access Tokens.
-
Choose Fine-grained tokens.
-
Click Generate new token to begin creating a new token.
-
Provide a token name so it can be easily identified later.
-
Set an expiration date for the token.
Shorter expiration periods are recommended for improved security. -
Under Repository Access, choose Only select repositories.
-
Select the specific repository you want the token to access.
-
Configure the required permissions for the integration.
-
Click Generate token.
-
Copy the generated token immediately and store it securely.
GitHub displays the token only once for security reasons.
Field Reference
| Field | Description | Example |
|---|---|---|
| Token Name | A descriptive name to identify the token in GitHub | DeepTraQ Integration Token |
| Expiration Date | Defines how long the token remains valid | 30 days |
| Repository Access | Specifies whether the token can access all repositories or only selected ones | Only selected repositories |
| Repository Selection | The specific repository the integration can access | deeptraq-security-scanner |
| Permissions | Defines what actions the integration can perform | Read access to repository metadata |
Related Articles
- Connecting GitHub Repositories
- Creating a Code Scan
- Managing Integrations