This commit adds the gitlab_list_merge_requests() function, which allows
the caller to retrieve a list of merge requests for a given scope. If no
scope is specified, all merge requests that the user is assigned to will
be returned.
return 0
}
+gitlab_list_merge_requests() {
+ local host="$1"
+ local token="$2"
+ local scope="$3"
+
+ local url
+ local resp
+
+ if [[ -z "$scope" ]]; then
+ scope="assigned_to_me"
+ fi
+
+ url="$host/api/v4/merge_requests?scope=$scope"
+
+ if ! resp=$(_gitlab_get "$token" "$url"); then
+ return 1
+ fi
+
+ echo "$resp"
+ return 0
+}
+
gitlab_get_project_id() {
local host
local token