import { getRootConfig } from '@configs/root.config'; import { getWorkingStartConfig } from '@configs/w-start/w-start.config'; import { withRequestLogger } from '@loggers/withRequestLogger'; import { getWorkingInfo } from '@questions/getWorkingInfo'; import { checkOutBranch } from '@utils/checkOutBranch'; import GitHubService from 'service/github/github.service'; const config = getWorkingStartConfig(getRootConfig()?.['w:start']); const github = new GitHubService({ auth: config.token, owner: config.owner, assignees: config.assignees, repo: config.repoName, }); const createIssue = withRequestLogger( github.createGithubIssue, 'Create-Github-Issue', ); export async function workingStartResolver() { const { title, detail, labels } = await getWorkingInfo({ issueLabels: config.labels, }); const issue = await createIssue({ title, detail, label: labels, }); // const issueNumber = issue?.data.number; checkOutBranch(`${issueNumber}-${title}`); }