Skip to contents

Determines a GitLab project's default Git branch name.

Usage

project_default_branch(
  id_project = funky::config_val("id_project"),
  base_url = funky::config_val("base_url"),
  token = funky::config_val("token"),
  max_tries = 3L
)

Arguments

id_project

integer(1)
GitLab project identifier.

base_url

character(1)
Base URL to the GitLab v4 RESTful API root.

token

character(1)
GitLab access token used for authentication. If NULL, the API request is made unauthenticated which results in HTTP 404 Not Found and other errors for non-public resources.

max_tries

integer(1)
Maximum number of request attempts in case of an HTTP error. An integerish scalar. Retries are performed using exponential backoff and jitter, see httr2::req_retry() for details.

Value

A character scalar.

See also

Other functions to manage GitLab projects: project()

Examples

gitlab::project_default_branch(id_project = 64767928)
#> [1] "main"