Skip to content

GitHub Repo Backend

Path: issues.backends.github_repo.Backend

The GitHub Repo backend creates an issue in a specified GitHub repository and uploads screenshots to the repository.

Note

This backend require the public_repo permission granted to the token

Options:

  • API_TOKEN: Your GitHub personal access token with public_repo scope for public repositories, or repo scope for private repositories.

  • PROJECT: The username or organization and project name repository.

  • SCREENSHOT_REPO_PATH: The path in the repository where screenshots will be stored.

  • SCREENSHOT_BRANCH: The branch where screenshots will be stored.

Example:

# settings.py

ISSUES = {
    "BACKEND": "issues.backends.github_repo.Backend",
    "OPTIONS": {
        "API_TOKEN": "ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "PROJECT": "user/repo",
        "SCREENSHOT_REPO_PATH": "screenshots/",
        "SCREENSHOT_BRANCH": "main",
    }
}

How to configure your token

1) Classic Personal Access Token (PAT)
  1. Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic).
  2. Click Generate new token → Generate new token (classic).
  3. Give it a descriptive note and set an expiration date.
  4. Under Select scopes, check:

    • repo → this covers both public and private repositories.
    • If you only want public repositories, you can instead check public_repo.
  5. Click Generate token.

  6. Copy the token (you won’t be able to see it again).

In this case, the public_repo scope will appear explicitly in the list.


2) Fine-grained Personal Access Token
  1. Go to GitHub Settings → Developer settings → Personal access tokens → Fine-grained tokens.
  2. Click Generate new token.
  3. Choose:
    • Resource owner (your account or organization).
    • Repository access → pick All repositories or specific ones.
  4. Under Repository permissions, set the level you need.

    sc

  5. Click Generate token.