fix(#151): fix gitlab post comments url (#152)
Some checks are pending
main ci / ubuntu-latest - node 20 (push) Waiting to run
main ci / ubuntu-latest - node 16 (push) Waiting to run
main ci / ubuntu-latest - node 18 (push) Waiting to run

This commit is contained in:
Andrea Lamparelli 2025-04-14 17:48:09 +02:00 committed by GitHub
parent 3a9d367b48
commit d74a787035
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 14 additions and 6 deletions

6
dist/cli/index.js vendored
View file

@ -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) {