Connect GitHub or GitLab
Give Guardian read access to the repositories you are authorized to assess.
GitHub connection
Create a fine-grained GitHub personal access token restricted to the selected repositories, with Contents set to Read-only.
- Open Integrations, find GitHub and select Connect.
- Use https://api.github.com as the API base URL, not your GitHub profile URL.
- Enter the token, save the connection and select Test.
- Register a Code repository asset as github.com/owner/repository. The repository is entered separately from the API base URL.
GitLab and token maintenance
For GitLab, use a token with repository read access and register gitlab.com/group/project. Rotate expired or revoked credentials. Repository analysis currently supports GitHub and GitLab; Bitbucket source analysis is not supported.
Connection errors
A 406 response can indicate a website URL was used instead of the API base. A 401 can indicate invalid or expired credentials; a 403 or 404 may indicate access restrictions or a repository the token cannot read. Review the error before changing permissions.
