UNPKG

@google-automations/issue-utils

Version:
38 lines (37 loc) 1.51 kB
import { Octokit } from '@octokit/rest'; import { GCFLogger } from 'gcf-utils'; export { addOrUpdateIssueComment } from './issue-comments'; export interface Issue { owner: string; repo: string; number: number; title: string; body: string; labels: string[]; } /** * Opens or edits an existing issue that matches the issue title and * authenticated user. * * @param {Octokit} octokit - The Octokit instance. * @param {string} owner - The owner of the repository. * @param {string} repo - The name of the repository. * @param {string} title - The issue title. * @param {string} body - The issue body. * @param {string[]} labels - Labels to attach to the issue. * @param {GCFLogger} logger - A context logger. * @returns {Issue} The created or updated issue. */ export declare function addOrUpdateIssue(octokit: Octokit, owner: string, repo: string, title: string, body: string, labels: string[], logger?: GCFLogger): Promise<Issue>; /** * Closes an existing issue that matches the issue title and * authenticated user. * * @param {Octokit} octokit - The Octokit instance. * @param {string} owner - The owner of the repository. * @param {string} repo - The name of the repository. * @param {string} title - The issue title. * @param {GCFLogger} logger - A context logger. * @returns {Issue} The created or updated issue. */ export declare function closeIssue(octokit: Octokit, owner: string, repo: string, title: string, logger?: GCFLogger): Promise<Issue | null>;