auto-changelog-generator
Version:
The script includes error handling to log any issues encountered during the fetch operations. If an error occurs while fetching issues or labels, it logs the error to the console and continues processing the next item.
21 lines (17 loc) • 669 B
JavaScript
import {Octokit} from "@octokit/rest";
import getTagPrListWithIssues from "./modules/getTagPrListWithIssues.js";
import createMarkdown from "./modules/createMarkdown.js";
async function createMarkdownText(options) {
const {githubToken, repoOwner, repoName} = options;
const issueUrl = `https://github.com/${repoOwner}/${repoName}/issues/`;
const octokit = await new Octokit({
auth: githubToken,
});
try {
const jsonObject = await getTagPrListWithIssues(octokit, repoOwner, repoName);
return await createMarkdown(jsonObject, issueUrl);
} catch (e) {
console.error(e);
}
}
export default createMarkdownText;