Skip to content

Commit

Permalink
Remove default PR params from action
Browse files Browse the repository at this point in the history
  • Loading branch information
yassine-cc committed Sep 27, 2024
1 parent 51019d2 commit e624536
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 30 deletions.
25 changes: 10 additions & 15 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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
Expand Down Expand Up @@ -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"));
Expand Down
16 changes: 5 additions & 11 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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
Expand Down
9 changes: 5 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down

0 comments on commit e624536

Please sign in to comment.