Github

This guide outlines the steps to generate a Personal Access Token (PAT) on GitHub

You can choose between a Classic Personal Access Token (PAT) for broad access or a Fine-Grained PAT for more precise, secure, and customizable permissions. Both authenticate with GitHub, but Fine-Grained PATs offer greater control.

Classic Personal Access Token

Steps to Generate a Classic PAT

  1. Go to GitHub SettingsDeveloper settingsPersonal access tokensTokens (classic).
  2. Click Generate new token.
  3. Provide a descriptive name in the Note field.
  4. Select No Expiration under Expiration.
  5. Choose the required Scopes:
    • repo
    • read:org
    • read:user
    • user:email
  6. Click Generate token.
  7. Copy and securely store the token (it will be shown only once).



Fine-Grained Personal Access Token

Steps to Generate a Fine-Grained PAT

  1. Go to GitHub SettingsDeveloper settingsPersonal access tokensFine-Grained Tokens.
  2. Click Generate new token.
  3. Enter a token name.
  4. Select No expiration under Expiration.
  5. Choose the Resource owner:
    • If selecting an organization, ensure approval if required.
  6. Under Repository access, select All repositories.
  7. Assign Permissions:
    • For an organization:
      • Members (read), Administration (read), Repository Administration (read)
      • Issues (write), Pull Requests (write)
    • For a repository:
      • Issues (write), Pull Requests (write), Email addresses (read)
  8. Click Generate token and copy it immediately.

Your token is now ready for authentication with GitHub.