mlab docs

Add a repository

Connect GitHub or GitLab to bring in your repositories, private ones included, or prove a public repository with a .mlab file.

A repository has to be proven before it is scanned: it shows that your organization controls it. Repositories belong to the organization; every member sees them in Repositories, and the owner and admins add, prove and remove them.

How it is provenPrivate repositoriesHow scans start
Connecting the GitHub AppYesBy hand, on connect, on a schedule, on push
Connecting GitLab (Cloud) or GitLab (Self-Managed)YesBy hand, on connect, on a schedule, on push
A .mlab fileNo, public repositories onlyBy hand

Connect GitHub or GitLab

It is the recommended way. Connecting your account proves every repository you give code.mlab.sh access to in one go, private ones included, keeps the list in sync, and lets them be scanned automatically:

They are all in Integrations.

With a .mlab file

A public repository on GitHub or GitLab.com can also be proven on its own with a .mlab file, without connecting anything. It is then scanned by hand only. Another forge (Bitbucket, Codeberg...)? Ask for it on GitHub Discussions.

Add the repository

In Repositories → Add with a .mlab file, paste the repository: its web address (https://github.com/acme/website), its clone address ([email protected]:acme/website.git) or the raw URL of its .mlab. GitLab subgroups are supported.

Commit the .mlab file

The repository page shows a line VERIF_CODE=<token>. Add a plain text file named .mlab holding it at the root of the default branch, then commit and push. The file can hold other KEY=value lines and # comments for other tools; only VERIF_CODE is read, and you can keep the line after the check.

# .mlab
VERIF_CODE=mlab-repo-3f2a9c1e-5b7d-4e2a-9c1f-0a8b7d6e5f43

Check

Click Check the .mlab file. code.mlab.sh reads it at https://raw.githubusercontent.com/<owner>/<repo>/HEAD/.mlab (GitHub) or https://gitlab.com/<path>/-/raw/HEAD/.mlab (GitLab).

The file is on another branch? Paste its raw URL in the optional field before checking, for example https://raw.githubusercontent.com/acme/website/release/.mlab. It must be the .mlab at the root of that same repository.

A repository first proven with a .mlab file and later reached by the GitHub App or GitLab is taken over by the integration rather than added twice.

Remove a repository

On the repository's Settings tab, Remove repository takes it out of your list. Its scan history is kept.

On this page