Manage merge requests
gl_create_merge_request(
project,
source_branch,
target_branch = get_main(),
title,
description,
...
)
gl_edit_merge_request(project, merge_request_iid, ...)
gl_close_merge_request(project, merge_request_iid)
gl_delete_merge_request(project, merge_request_iid, ...)
gl_list_merge_requests(project, ...)
id (preferred way) or name of the project. Not repository name.
name of branch to be merged
name of branch into which to merge
title of the merge request
description text for the merge request
passed on to gitlab()
.
Might contain more fields documented in GitLab API doc.
iid of the merge request
Tibble of created or remaining merge requests of the project with informative variables.
if (FALSE) {
set_gitlab_connection(
gitlab_url = "https://gitlab.com",
private_token = Sys.getenv("GITLAB_COM_TOKEN")
)
# Create MR and get its information
mr_infos <- gl_create_merge_request(
project = "<<your-project-id>>",
source_branch = "my-extra-branch",
title = "Merge extra to main", description = "These modifications are wonderful"
)
# List all opened MR
gl_list_merge_requests(project = "<<your-project-id>>", status = "opened")
# Edit MR created
gl_edit_merge_request(
project = "<<your-project-id>>", merge_request_iid = mr_infos$iid,
assignee_id = "<<user-id>>"
)
# Close MR
gl_close_merge_request(project = "<<your-project-id>>", merge_request_iid = mr_infos$iid)
# Delete MR as it never existed
gl_delete_merge_request(project = "<<your-project-id>>", merge_request_iid = mr_infos$iid)
}