0
0
mirror of https://github.com/renovatebot/renovate.git synced 2024-12-22 21:48:32 +00:00
renovatebot_renovate/lib/modules/platform/gitlab/merge-request.ts
2023-11-07 15:50:29 +00:00

27 lines
719 B
TypeScript

import { logger } from '../../../logger';
import { gitlabApi } from './http';
import type { GitLabMergeRequest, UpdateMergeRequest } from './types';
export async function getMR(
repository: string,
iid: number,
): Promise<GitLabMergeRequest> {
logger.debug(`getMR(${iid})`);
const url = `projects/${repository}/merge_requests/${iid}?include_diverged_commits_count=1`;
return (await gitlabApi.getJson<GitLabMergeRequest>(url)).body;
}
export async function updateMR(
repository: string,
iid: number,
data: UpdateMergeRequest,
): Promise<void> {
logger.debug(`updateMR(${iid})`);
const url = `projects/${repository}/merge_requests/${iid}`;
await gitlabApi.putJson(url, {
body: data,
});
}