Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
.env
.DS_Store
7 changes: 7 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ inputs:
Specify if a PR should be created with the updated test results. Defaults to "false"
default: "false"
required: false
clone-repo:
type: boolean
description: >-
Whether to clone the repository, defaults to "true"
Used for desktop app testing
required: false
default: "true"
pr-title:
description: >-
The title of the PR to be created
Expand Down
10 changes: 8 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33636,10 +33636,12 @@ const chalk = __nccwpck_require__(8818);
class Config {
constructor() {
let createPR = core.getInput("create-pr")?.toLowerCase()?.trim() || "false";
if (!["true", "false"].includes(createPR)) {
throw new Error("Invalid value for create-pr. It should be a boolean");
let cloneRepo = core.getInput("clone-repo")?.toLowerCase()?.trim() || "true";
if (!["true", "false"].includes(createPR) || !["true", "false"].includes(cloneRepo)) {
throw new Error("Invalid value for create-pr or clone-repo. They should be booleans");
} else {
createPR = JSON.parse(createPR);
cloneRepo = JSON.parse(cloneRepo);
}

this.input = {
Expand All @@ -33650,6 +33652,7 @@ class Config {
os: core.getInput("os") || "windows",
version: core.getInput("version") || "latest",
createPR,
cloneRepo,
prBase: createPR ? core.getInput("pr-base") || "main" : "",
prBranch: createPR ? core.getInput("pr-branch") : "",
prTitle: createPR ? core.getInput("pr-title") : "",
Expand Down Expand Up @@ -40082,6 +40085,7 @@ axios.interceptors.response.use(
let testdriverBranch = config.input.branch;
let key = config.input.key;
let os = config.input.os;
let cloneRepo = config.input.cloneRepo;
let testdriveraiVersion = config.input.version;
let createPR = config.input.createPR;
let prBranch = config.input.prBranch;
Expand All @@ -40100,6 +40104,7 @@ axios.interceptors.response.use(
console.log(chalk.yellow("repo:"), repo);
console.log(chalk.yellow("branch:"), branch);
console.log(chalk.yellow("os:"), os);
console.log(chalk.yellow("cloneRepo:"), cloneRepo);
console.log(chalk.yellow("createPR:"), createPR);
if (createPR) {
if (prBranch) console.log(chalk.yellow("prBranch:"), prBranch);
Expand Down Expand Up @@ -40136,6 +40141,7 @@ axios.interceptors.response.use(
branch,
prompt,
os,
cloneRepo,
prerun,
version: testdriverBranch,
key,
Expand Down
7 changes: 5 additions & 2 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ const chalk = require("chalk");
class Config {
constructor() {
let createPR = core.getInput("create-pr")?.toLowerCase()?.trim() || "false";
if (!["true", "false"].includes(createPR)) {
throw new Error("Invalid value for create-pr. It should be a boolean");
let cloneRepo = core.getInput("clone-repo")?.toLowerCase()?.trim() || "true";
if (!["true", "false"].includes(createPR) || !["true", "false"].includes(cloneRepo)) {
throw new Error("Invalid value for create-pr or clone-repo. They should be booleans");
} else {
createPR = JSON.parse(createPR);
cloneRepo = JSON.parse(cloneRepo);
}

this.input = {
Expand All @@ -19,6 +21,7 @@ class Config {
os: core.getInput("os") || "windows",
version: core.getInput("version") || "latest",
createPR,
cloneRepo,
prBase: createPR ? core.getInput("pr-base") || "main" : "",
prBranch: createPR ? core.getInput("pr-branch") : "",
prTitle: createPR ? core.getInput("pr-title") : "",
Expand Down
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ axios.interceptors.response.use(
let testdriverBranch = config.input.branch;
let key = config.input.key;
let os = config.input.os;
let cloneRepo = config.input.cloneRepo;
let testdriveraiVersion = config.input.version;
let createPR = config.input.createPR;
let prBranch = config.input.prBranch;
Expand All @@ -90,6 +91,7 @@ axios.interceptors.response.use(
console.log(chalk.yellow("repo:"), repo);
console.log(chalk.yellow("branch:"), branch);
console.log(chalk.yellow("os:"), os);
console.log(chalk.yellow("cloneRepo:"), cloneRepo);
console.log(chalk.yellow("createPR:"), createPR);
if (createPR) {
if (prBranch) console.log(chalk.yellow("prBranch:"), prBranch);
Expand Down Expand Up @@ -126,6 +128,7 @@ axios.interceptors.response.use(
branch,
prompt,
os,
cloneRepo,
prerun,
version: testdriverBranch,
key,
Expand Down