mirror of
https://github.com/kiegroup/git-backporting.git
synced 2025-05-11 03:03:43 +00:00
parent
3a9d367b48
commit
d74a787035
4 changed files with 14 additions and 6 deletions
6
dist/cli/index.js
vendored
6
dist/cli/index.js
vendored
|
@ -1151,7 +1151,9 @@ class GitLabClient {
|
|||
// example: <host>/api/v4/projects/<namespace>%2Fbackporting-example/merge_requests/1
|
||||
async getPullRequest(namespace, repo, mrNumber, squash) {
|
||||
const projectId = this.getProjectId(namespace, repo);
|
||||
const { data } = await this.client.get(`/projects/${projectId}/merge_requests/${mrNumber}`);
|
||||
const url = `/projects/${projectId}/merge_requests/${mrNumber}`;
|
||||
this.logger.debug(`Fetching pull request ${url}`);
|
||||
const { data } = await this.client.get(`${url}`);
|
||||
if (squash === undefined) {
|
||||
squash = (0, git_util_1.inferSquash)(data.state === "opened", data.squash_commit_sha);
|
||||
}
|
||||
|
@ -1241,7 +1243,7 @@ class GitLabClient {
|
|||
try {
|
||||
const { namespace, project, id } = this.extractMergeRequestData(mrUrl);
|
||||
const projectId = this.getProjectId(namespace, project);
|
||||
const { data } = await this.client.post(`/projects/${projectId}/issues/${id}/notes`, {
|
||||
const { data } = await this.client.post(`/projects/${projectId}/merge_requests/${id}/notes`, {
|
||||
body: comment,
|
||||
});
|
||||
if (!data) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue