import { Gitlab } from "../../types/gitlab" import netTool from "../netTool" import { GITLAB_AUTH_HEADER, GITLAB_BASE_URL, gitlabReqWarp } from "./tools" /** * 检索与特定提交关联的合并请求。 * @param {number} project_id - 项目的ID。 * @param {string} sha - 提交的SHA。 * @returns {Promise} 一个解析为合并请求数组的promise。 */ const getMr = async ( project_id: number, sha: string ): Promise => { const URL = `${GITLAB_BASE_URL}/projects/${project_id}/repository/commits/${sha}/merge_requests` return gitlabReqWarp( () => netTool.get(URL, {}, GITLAB_AUTH_HEADER), [] ) } const commit = { getMr, } export default commit