Hosts and tokens
Public repositories on github.com and gitlab.com work without any setup, with the hosts' lower rate limits for requests without a token. Other hosts, private repositories, and GitHub's Dependabot alerts and Actions variables need a token:
- Create a read-only token for the host:
- On GitHub, a fine-grained personal access token with the repository permissions the formatters you use need: Contents (file data and Composer versions), Dependabot alerts, Variables or Secrets.
- On GitLab, a personal, group or project access token with the
read_apiscope.
- Add the token as a "Git host token" key at Configuration > System > Keys (
/admin/config/system/keys), with the provider and host, as Git Host's README describes. The Git Host module reads from the hosts for this module, and only sends each token to its own host.
Adding a key with a new host adds it to the hosts the field accepts. Removing a key stops its repositories' data from showing, with a "No key is set up" message instead.