async createNotificationComment(github) {
    const [botComment] = await github.getBotComments(this.pr.number);
    const notifies = this.getOwnersToNotify();
    delete notifies[this.pr.author];

    const fileNotifyComments = Object.entries(
      notifies
    ).map(([name, filenames]) =>
      [
        `Hey @${name}, these files were changed:`,
        '```',
        ...filenames,
        '```',
      ].join('\n')
    );

    if (!fileNotifyComments.length) {
      return;
    }

    const comment = fileNotifyComments.join('\n\n');
    if (botComment) {
      await github.updateComment(botComment.id, comment);
    } else {
      await github.createBotComment(this.pr.number, comment);
    }
  }
/**
   * Adds a comment tagging always-notify owners of changed files.
   *
   * @param {!GitHub} github GitHub API interface.
   */
Adds a comment tagging always-notify owners of changed files.
Adds a comment tagging always - notify owners of changed files .
async createNotificationComment(github) {
    const [botComment] = await github.getBotComments(this.pr.number);
    const notifies = this.getOwnersToNotify();
    delete notifies[this.pr.author];
    const fileNotifyComments = Object.entries(
      notifies
    ).map(([name, filenames]) =>
      [
        `Hey @${name}, these files were changed:`,
        '```',
        ...filenames,
        '```',
      ].join('\n')
    );
    if (!fileNotifyComments.length) {
      return;
    }
    const comment = fileNotifyComments.join('\n\n');
    if (botComment) {
      await github.updateComment(botComment.id, comment);
    } else {
      await github.createBotComment(this.pr.number, comment);
    }
  }
async createNotificationComment ( github ) { const [ botComment ] = await github . getBotComments ( this . pr . number ) ; const notifies = this . getOwnersToNotify ( ) ; delete notifies [ this . pr . author ] ; const fileNotifyComments = Object . entries ( notifies ) . map ( ( [ name , filenames ] ) => [ ` ${ name } ` , '```' , ... filenames , '```' , ] . join ( '\n' ) ) ; if ( ! fileNotifyComments . length ) { return ; } const comment = fileNotifyComments . join ( '\n\n' ) ; if ( botComment ) { await github . updateComment ( botComment . id , comment ) ; } else { await github . createBotComment ( this . pr . number , comment ) ; } }
Adds a comment tagging always-notify owners of changed files.
Adds a comment tagging always - notify owners of changed files .