@google-automations/issue-utils
Version:
Utilities for github issues
33 lines (32 loc) • 1.27 kB
TypeScript
import { Octokit } from '@octokit/rest';
/**
* It creates a comment string used for `addOrUpdateissuecomment`.
*/
export declare const getCommentMark: (installationId: number) => string;
export interface IssueComment {
owner: string;
repo: string;
issueNumber: number;
body: string;
htmlUrl: string;
}
interface AddOrUpdateIssueCommentOptions {
onlyUpdate?: boolean;
}
/**
* It creates a comment, or if the bot already created a comment, it
* updates the same comment.
*
* @param {Octokit} octokit - The Octokit instance.
* @param {string} owner - The owner of the issue.
* @param {string} repo - The name of the repository.
* @param {number} issueNumber - The number of the issue.
* @param {number} installationId - A unique number for identifying the issue
* comment.
* @param {string} commentBody - The body of the comment.
* @param {AddOrUpdateIssueCommentOptions} options
* @param {boolean} options.onlyUpdate - If set to true, it will only update an
* existing issue comment.
*/
export declare const addOrUpdateIssueComment: (octokit: Octokit, owner: string, repo: string, issueNumber: number, installationId: number, commentBody: string, options?: AddOrUpdateIssueCommentOptions) => Promise<IssueComment | null>;
export {};