MCPcopy Index your code
hub / github.com/wei/pull / createPR

Method createPR

src/processor/pull.ts:327–390  ·  view source on GitHub ↗
(
    base: string,
    upstream: string,
    assignees: string[],
    reviewers: string[],
  )

Source from the content-addressed store, hash-verified

325 }
326
327 private async createPR(
328 base: string,
329 upstream: string,
330 assignees: string[],
331 reviewers: string[],
332 ) {
333 try {
334 const createdPR = await this.github.pulls.create({
335 owner: this.owner,
336 repo: this.repo,
337 head: upstream,
338 base,
339 maintainer_can_modify: false,
340 title: getPRTitle(base, upstream),
341 body: getPRBody(this.fullName),
342 });
343
344 const prNumber = createdPR.data.number;
345 this.logger.debug(
346 `#${prNumber} Created pull request`,
347 );
348
349 try {
350 await this.github.issues.lock({
351 owner: this.owner,
352 repo: this.repo,
353 issue_number: prNumber,
354 });
355 } catch (err) {
356 this.logger.error(
357 { err },
358 `#${prNumber} Lock failed`,
359 );
360 }
361
362 await this.github.issues.update({
363 owner: this.owner,
364 repo: this.repo,
365 issue_number: prNumber,
366 assignees,
367 labels: [this.config.label],
368 body: getPRBody(this.fullName, prNumber),
369 });
370
371 await this.addReviewers(prNumber, reviewers);
372 this.logger.debug(
373 `#${prNumber} Updated pull request`,
374 );
375
376 const pr = await this.github.pulls.get({
377 owner: this.owner,
378 repo: this.repo,
379 pull_number: prNumber,
380 });
381
382 return pr.data;
383 } catch (err) {
384 this.logger.error(

Callers 1

routineCheckMethod · 0.95

Calls 3

addReviewersMethod · 0.95
getPRTitleFunction · 0.90
getPRBodyFunction · 0.90

Tested by

no test coverage detected