Deletes a file from a GitLab repository via the
DELETE /projects/{id_project}/repository/files/{path} endpoint of
GitLab's v4 RESTful API.
Usage
file_delete(
path,
id_project = funky::config_val("id_project"),
start_branch = project_default_branch(id_project = id_project, base_url = base_url,
token = token, max_tries = max_tries),
branch = start_branch,
commit_message = "auto: delete file via gitlab R pkg",
author_email = NULL,
author_name = NULL,
last_commit_id = NULL,
base_url = funky::config_val("base_url"),
token = funky::config_val("token"),
max_tries = 3L
)Arguments
- path
character(1)
File path, relative to the repository root.- id_project
integer(1)
GitLab project identifier.- start_branch
character(1)
Name of the base branch to createbranchfrom if it doesn't already exist.- branch
character(1)
Git branch name to upload the file to.- commit_message
character(1)
Git commit message.character(1)
Git commit author's email address.NULLmeans to default to thetokenowner.character(1)
Git commit author's name.NULLmeans to default to thetokenowner.- last_commit_id
character(1)
Last known file commit identifier. If provided (and valid), GitLab won't write to the file if a commit made afterlast_commit_idhas modified the file. Intended to avoid concurrency issues (e.g. from CI pipelines).NULLmeans to skip the check.- base_url
character(1)
Base URL to the GitLab v4 RESTful API root.- token
character(1)
GitLab access token used for authentication. IfNULL, 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, seehttr2::req_retry()for details.
See also
Other functions to manage files on GitLab:
commit_files(),
file_commit_action(),
file_content(),
file_create(),
file_exists(),
file_full(),
file_meta(),
file_req(),
file_update(),
file_write(),
files_delete()