Set up GitHub for Git versioning

Use this guide to prepare GitHub before enabling Git versioning in Leapwork Flow. An organization-owned private repository is recommended when multiple people will use the feature.

Before you begin

  • Confirm that you have access to the GitHub organization that will own the repository.

  • Identify the Leapwork administrators and contributors who need repository access.

  • Create one repository for each Leapwork team that will use Git versioning.

Create a private repository

  1. Open the GitHub organization.

  2. Select Repositories > New repository.

  3. Select the organization as the owner.

  4. Enter a repository name.

  5. Set the repository visibility to Private.

  6. Select Create repository.

You can initialize the repository with a README. Do not add rules that prevent Leapwork from writing version files unless Engineering has confirmed they are compatible.

Give users repository access

  1. Open the repository and select Settings.

  2. Open Collaborators and teams or Manage access.

  3. Add the required GitHub team or users.

  4. Give identities that upload version data Write access.

GitHub’s Write repository role is normally sufficient for pushing version data. Organization-owner access is not required just to upload versions.

Create a fine-grained personal access token

Create a token for each credential used by Leapwork:

Token

Repository access

Permission

Connection PAT

Repositories the administrator needs to list in Leapwork

Metadata: Read-only

Repository PAT

The mapped repository

Contents: Read and write

User PAT

The mapped repository

Contents: Read and write

  1. In GitHub, open Settings > Developer settings > Personal access tokens > Fine-grained tokens.

  2. Select Generate new token.

  3. Enter a descriptive name and expiration date.

  4. Select the GitHub organization or user that owns the repository.

  5. Under Repository access, select Only select repositories, then choose the mapped repository.

  6. Set permissions according to the table above.

  7. Select Generate token.

  8. Copy the token and store it in your approved secret-management system.

GitHub shows the token only once. Never include it in a document, ticket, chat, email, or source-control file.

If your organization requires approval for fine-grained tokens, ask an organization owner to review and approve the request.

Provide the connection details

Give the Leapwork administrator the following through an approved secrets channel:

  • GitHub API URL: https://api.github.com/

  • Connection PAT

  • Repository owner and repository name

  • Repository PAT

  • Whether the team will use individual User PATs or the Repository PAT fallback