Skip to content

GitHub ​

The GitHub Source connects an AI System to one repository on github.com. Scout, Agent Tests, and the Risk Agent read the files and find code in the repository. Metric Tests cannot use a GitHub Source.

Used byAgent Tests, Scout, Risk Agent
ModePull
CredentialsA personal access token, for private repositories and for code search
Metric selectionNot applicable

The GitHub Source belongs to the AI System and all its members use it. The GitHub Connector is different: it belongs to one user. See Scout Connectors.

Where in Modulos ​

  • AI System → Settings → Sources → Add Source → GitHub adds the Source.

Before you start ​

  • An Organization Admin makes GitHub available. See Source & Connectors.
  • For a private repository, create a personal access token in GitHub, in Settings → Developer settings → Personal access tokens. Give it the repo scope.

Modulos reads the files of a public repository without a token. Code search needs a token, also for a public repository.

How to connect GitHub ​

  1. Open AI System → Settings → Sources.
  2. Select Add Source.
  3. Select GitHub.
  4. Type a Source Name.
  5. Type the URL of the repository in Repository URL, for example https://github.com/owner/repo.
  6. For a private repository, paste the token into Personal Access Token.
  7. Type the branch to read in Branch.
  8. Select Save.
Add Source dialog with GitHub selected: the connection instructions on the left, the fields on the right.
Add a GitHub Source.
  1. 1
    Personal Access Token
    Necessary for a private repository and for code search.
  2. 2
    Branch
    Empty: Modulos reads the main branch.

When you save, Modulos reads the repository. If Modulos does not find the repository, or the token cannot read it, the Source is not saved. Modulos does not check the branch.

Scout, Agent Tests, and the Risk Agent ​

Scout, Agent Tests, and the Risk Agent read a GitHub Source with read-only requests:

  • Code search: the 10 best results of a GitHub code search in the repository.
  • Files: the text of a file, by path or by SHA. A read by path stops after 3,000 characters.
  • Tree: the top-level folders and files of the branch, or one folder by its SHA.

Important considerations ​

  • If Branch is empty, Modulos reads the branch main. If the default branch of your repository has a different name, type it in Branch.
  • The code search uses the index of GitHub. It does not use the Branch field.
  • Modulos reads text files only.
  • The URL must start with https://github.com/. Modulos cannot connect to GitHub Enterprise Server.
  • Add one GitHub Source for each repository.