diff --git a/dist/index.js b/dist/index.js index bbf4c73..bfa99a0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -33640,7 +33640,7 @@ class Config { } else { createPR = JSON.parse(createPR); } - const random = Math.random().toString(36).substring(7); + this.input = { prompt: core.getInput("prompt"), prerun: core.getInput("prerun"), @@ -33649,16 +33649,10 @@ class Config { os: core.getInput("os") || "windows", version: core.getInput("version") || "latest", createPR, - prBase: createPR ? core.getInput("pr-base") || "main" : "", - prBranch: createPR - ? core.getInput("pr-branch") || `testdriver/test-${random}` - : "", - prTitle: createPR - ? core.getInput("pr-title") || `Testdriver-${random}` - : "", - prTestFilename: createPR - ? core.getInput("pr-test-filename") || `testdriver-${random}.yml` - : "", + prBase: createPR ? core.getInput("pr-base") : "", + prBranch: createPR ? core.getInput("pr-branch") : "", + prTitle: createPR ? core.getInput("pr-title") : "", + prTestFilename: createPR ? core.getInput("pr-test-filename") : "", }; // the values of github.context.repo.owner and github.context.repo.repo are taken from @@ -40033,10 +40027,11 @@ const waitFor = (ms) => new Promise((r) => setTimeout(r, ms)); console.log(chalk.yellow("os:"), os); console.log(chalk.yellow("createPR:"), createPR); if (createPR) { - console.log(chalk.yellow("prBranch:"), prBranch); - console.log(chalk.yellow("prBase:"), prBase); - console.log(chalk.yellow("prTitle:"), prTitle); - console.log(chalk.yellow("prTestFilename:"), prTestFilename); + if (prBranch) console.log(chalk.yellow("prBranch:"), prBranch); + if (prBase) console.log(chalk.yellow("prBase:"), prBase); + if (prTitle) console.log(chalk.yellow("prTitle:"), prTitle); + if (prTestFilename) + console.log(chalk.yellow("prTestFilename:"), prTestFilename); } console.log(chalk.yellow("prompt:")); console.log(prompt.replace(/\\n/g, "\n").replace(/\\r\\n/g, "\r\n")); diff --git a/src/config.js b/src/config.js index 48b318d..50aee82 100644 --- a/src/config.js +++ b/src/config.js @@ -9,7 +9,7 @@ class Config { } else { createPR = JSON.parse(createPR); } - const random = Math.random().toString(36).substring(7); + this.input = { prompt: core.getInput("prompt"), prerun: core.getInput("prerun"), @@ -18,16 +18,10 @@ class Config { os: core.getInput("os") || "windows", version: core.getInput("version") || "latest", createPR, - prBase: createPR ? core.getInput("pr-base") || "main" : "", - prBranch: createPR - ? core.getInput("pr-branch") || `testdriver/test-${random}` - : "", - prTitle: createPR - ? core.getInput("pr-title") || `Testdriver-${random}` - : "", - prTestFilename: createPR - ? core.getInput("pr-test-filename") || `testdriver-${random}.yml` - : "", + prBase: createPR ? core.getInput("pr-base") : "", + prBranch: createPR ? core.getInput("pr-branch") : "", + prTitle: createPR ? core.getInput("pr-title") : "", + prTestFilename: createPR ? core.getInput("pr-test-filename") : "", }; // the values of github.context.repo.owner and github.context.repo.repo are taken from diff --git a/src/index.js b/src/index.js index 369dbe3..1f01791 100644 --- a/src/index.js +++ b/src/index.js @@ -57,10 +57,11 @@ const waitFor = (ms) => new Promise((r) => setTimeout(r, ms)); console.log(chalk.yellow("os:"), os); console.log(chalk.yellow("createPR:"), createPR); if (createPR) { - console.log(chalk.yellow("prBranch:"), prBranch); - console.log(chalk.yellow("prBase:"), prBase); - console.log(chalk.yellow("prTitle:"), prTitle); - console.log(chalk.yellow("prTestFilename:"), prTestFilename); + if (prBranch) console.log(chalk.yellow("prBranch:"), prBranch); + if (prBase) console.log(chalk.yellow("prBase:"), prBase); + if (prTitle) console.log(chalk.yellow("prTitle:"), prTitle); + if (prTestFilename) + console.log(chalk.yellow("prTestFilename:"), prTestFilename); } console.log(chalk.yellow("prompt:")); console.log(prompt.replace(/\\n/g, "\n").replace(/\\r\\n/g, "\r\n"));