Skip to main content

Create a Personal Access Token

Create a Personal Access Token that can be reused across all the GitHub repos you want to track.

  1. Navigate to the GitHub web portal and log in.
  2. Select your profile icon in the top right corner.
  3. Select Settings, then Developer Settings, then Personal Access Tokens.
  4. Select Fine-grained tokens and then Generate new token.
  5. Name the token GitHub Metrics.
  6. Set the Expiration. You probably want to set this to custom and set the date to 1 year in the future.
  7. Select All repositories, or if you want finer control, select Only select repositories and select the repos you want to track.
  8. Select Repository permissions.
  9. Select Administration to Read-only.
  10. Leave the remaining fields with their default values.
  11. Select Generate token.
  12. Copy the token to the clipboard.

Update the GitHub Secrets environment file

A GitHub secrets environment file simplifies the process of uploading the secrets to one or more GitHub repos.

Use the github.env file you received from the GitHub Metrics solution owner or the one you created in the Deploy the GitHub Metrics solution section.

  1. Open the github.env file in the config folder of the cloned repo.
  2. Update the REPORTING_PAT value with the Personal Access Token you copied to the clipboard in the previous step.
  3. Update the REPORTING_GROUP field. The group secret is used for consolidated reporting. The group name is arbitrary, for example, use your team name or your GitHub name.
  4. The REPORTING_ENDPOINT_URL and REPORTING_ENDPOINT_KEY values are populated by the GitHub Metrics solution owner.