This is a small utility for managing GitHub issues.
npm i @google-automations/issue-utils
addOrUpdateIssue
will automatically open or update a GitHub issue.
It searches for the issue by title and will update it if necessary.
Example usage:
import {addOrUpdateIssue} from '@google-automations/issue-utils';
const issue = await addOrUpdateIssue(
octokit,
'testOwner',
'testRepo',
'This is the title of the issue',
'This is the body of the issue',
['some-label', 'another-label']
);
console.log('Issue: ', issue.number);