diff --git a/src/commands/create-issue.ts b/src/commands/create-issue.ts index 415360d..ca59361 100644 --- a/src/commands/create-issue.ts +++ b/src/commands/create-issue.ts @@ -3,7 +3,7 @@ import fs from "node:fs"; import CreateIssueOpt from "./opts/create-issue-opt.js"; import {SleekCommand} from "../sleek-command.js"; -import {createIssue, getRepoName, getRepoOwner, validateInputFileSchema} from "../service/create-issue-svc.js"; +import {createIssue, validateInputFileSchema} from "../service/create-issue-svc.js"; import {issueData} from "../types/issue.js"; const Ajv = _Ajv as unknown as typeof _Ajv.default; @@ -31,11 +31,9 @@ export default class CreateIssue extends SleekCommand { // validateChart(helmCharName, helmChartVersion); // create issue base in the file input - const repo = flags.repo || getRepoName(); - const owner = flags.repoOwner || getRepoOwner(); const title = `Onboarding ${(data.body as issueData).sellerMarketPlaceAlias} ${(data.body as issueData).addon.name}@${(data.body as issueData).addon.version}`; const body= `Issue body:\n\n\`\`\`yaml\n${fileContents}\`\`\`\n`; - const createIssueResponse = await createIssue(repo, owner, title, body,this, ['pending']) + const createIssueResponse = await createIssue(title, body,this, ['pending']) this.log(`Issue created: ${createIssueResponse.body?.data.html_url}`) } diff --git a/src/service/create-issue-svc.ts b/src/service/create-issue-svc.ts index 0992a52..e4a0c4a 100644 --- a/src/service/create-issue-svc.ts +++ b/src/service/create-issue-svc.ts @@ -8,7 +8,10 @@ import type {OctokitResponse} from "@octokit/types/dist-types/OctokitResponse.js const Ajv = _Ajv as unknown as typeof _Ajv.default; -export async function createIssue(repo: string, owner: string, title: string, body: string, callerCommand: SleekCommand, labels: string[] = []): Promise>> { +export const createIssue = async (title: string, body: string, callerCommand: SleekCommand, labels: string[] = []): Promise>> => { + return createIssueOnRepo(getRepoName(), getRepoOwner(), title, body, callerCommand, labels) +} +const createIssueOnRepo = async (repo: string, owner: string, title: string, body: string, callerCommand: SleekCommand, labels: string[]): Promise>> => { const octokitOptions = { auth: process.env.GITHUB_TOKEN, }; @@ -67,10 +70,10 @@ function getSchemaUrl(): string { return 'https://raw.githubusercontent.com/elamaran11/aws-sleek-transformer/f96009d3feb4967b4d92fd57f4d1bd2cf148e1a9/src/schemas/issue-creation.schema.json' } -export function getRepoOwner() { +function getRepoOwner() { return 'cloudsoft-fusion'; } -export function getRepoName() { +function getRepoName() { return 'aws-k8s-addons' }