Skip to content

Setup Access Token

Kim Oliver Drechsel edited this page Aug 3, 2024 · 2 revisions

This page shows how to set up an access token for your deployments.

An access token is a way for your deployment to authenticate with the Git provider.

Table of Contents

GitHub

You can either use a personal access token or a GitHub App.

How to create an access token

See the GitHub docs for

Permissions

Personal access token (Classic)

  • The minimum required scope is repo

Fine-grained tokens

  • Repository access
    • Set to Public Repositories (read-only) for only public repositories.
    • Set to All Repositories for all repositories.
  • The minimum required permissions are:
    • Contents -> Read-only
    • Metadata -> Read-only

Gitea

  • Go to your user settings.
  • Click on Applications.
  • Under Generate New Token:
    • Fill in the Token Name field.
    • Set Repository and Organization Access to All
    • Open Select Permissions and set repository to Read
    • Click on Generate Token and save the token that is shown on the top of the page.

Allow access to the webhook endpoint

If you have issues reaching the app endpoint from Gitea, you may need to allow the domain or ip address of the app endpoint in the Gitea configuration:

  • Open the app.ini for Gitea, typically found at /etc/gitea/conf/app.ini, and add the environment of the app endpoint to the allowed webhooks list:
    [webhook]
    ALLOWED_HOST_LIST = webhook.example.com
    Replace webhook.example.com with the domain or ip address of the app endpoint. You can also use wildcards like *.example.com
  • Restart Gitea to apply the changes to the configuration.

Gitlab

You can either use a personal access token, a group access token or a project access token for Gitlab.

Recommended are personal or group access tokens, as they can be used for multiple projects/repositories.

Token Permissions

  • The role Reporter is sufficient (if asked).
  • The minimum required scope is read_repository.

How to create an access token

See the Gitlab docs for