Skip to content
Ona Docs

CheckRepositoryAccess

client.runners.checkRepositoryAccess(RunnerCheckRepositoryAccessParams { repositoryUrl, runnerId } body, RequestOptionsoptions?): RunnerCheckRepositoryAccessResponse { errorMessage, hasAccess }
POST/gitpod.v1.RunnerService/CheckRepositoryAccess

Checks if a principal has read access to a repository.

Use this method to:

  • Validate repository access before workflow execution
  • Verify executor credentials for automation bindings

Returns:

  • has_access: true if the principal can read the repository
  • FAILED_PRECONDITION if authentication is required
  • INVALID_ARGUMENT if the repository URL is invalid

Examples

  • Check access:

    Verifies read access to a repository.

    runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
    repositoryUrl: "https://github.com/org/repo"
ParametersExpand Collapse
body: RunnerCheckRepositoryAccessParams { repositoryUrl, runnerId }
repositoryUrl?: string

repository_url is the URL of the repository to check access for. Can be a clone URL (https://github.com/org/repo.git) or web URL (https://github.com/org/repo).

formaturi
runnerId?: string
formatuuid
ReturnsExpand Collapse
RunnerCheckRepositoryAccessResponse { errorMessage, hasAccess }
errorMessage?: string

error_message provides details when access check fails. Empty when has_access is true.

hasAccess?: boolean

has_access indicates whether the principal has read access to the repository.

CheckRepositoryAccess

import Gitpod from '@gitpod/sdk';

const client = new Gitpod({
  bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted
});

const response = await client.runners.checkRepositoryAccess({
  repositoryUrl: 'https://github.com/org/repo',
  runnerId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68',
});

console.log(response.errorMessage);
{
  "errorMessage": "errorMessage",
  "hasAccess": true
}
Returns Examples
{
  "errorMessage": "errorMessage",
  "hasAccess": true
}