GitHub Configuration

GitHub Configuration

Creating an Access Token in GitHub

Supported GitHub Authentication

You can use either classic personal access tokens or fine-grained personal access tokens. For more information on the differences between these token types, refer to the GitHub Docs.

Basic authentication (username and password) is not supported. This method is less secure and GitHub has deprecated its use for authenticating Git operations since August 13, 2021.

Required Permissions for Tokens (classic)

Feature Required GitHub Scope(s)
Automated Commit Feedback repo:status
Automated Pull Requests repo
Pull Request Commenting repo
Pull Request Line Commenting repo
Automatic Role Assignment user:email, read:user

See this explanation for details of GitHub scopes.

The items above are classic PAT scopes (coarse-grained). Fine-grained PATs use permissions instead (for example pull_requests=write).

Required Permissions for Fine-Grained Tokens

Fine-grained personal access tokens (PATs) are configured with:

GitHub’s REST API surfaces the technical permission strings for fine-grained permissions via the X-Accepted-GitHub-Permissions response header (examples include pull_requests=write and contents=read). The permission-string mappings below match GitHub’s published list for fine-grained PAT permissions.

Repository Permissions

Repository Permissions Access Levels Permission String
Administration Read-only administration=read
Commit statuses Read and write statuses=write
Contents Read and write contents=write
Deployments Read-only deployments=read
Metadata Read-only metadata=read
Pull requests Read and write pull_requests=write

How to Create the Access Token

  1. Log in to GitHub.
  2. In the upper-right corner, click your avatar and select Settings.
  3. In the left menu, click Developer Settings.
  4. In the left menu, select Fine-grained tokens or Tokens (classic).
  5. Click the Generate new token button.
  6. Select Generate new token for fine-grained, repo-scoped tokens, or Generate new token (classic) for general use.
  7. Save your PAT. You will not be able to view this token again.

Protecting the Target Branch in GitHub

You can prevent users from merging Pull Requests with failing IQ Policy Evaluations with a Branch Protection Rule. IQ Policy Evaluations must be set to Fail at the Source Stage.

To protect a branch:

  1. Select a Repository.
  2. Click Settings.
  3. Select Branches from the sidebar.
  4. Click Add rule or edit an existing rule.
  5. Check to Require status checks to pass before merging.
  6. Check IQ Policy Evaluation.
  7. Save Changes

Note The IQ Policy Evaluation status check will not appear in the list of status checks found in the last week for this repository until the first policy evaluation status has been added to the repository.