Skip to content

Commit

Permalink
Merge pull request #31 from testdriverai/yassine/fix-new-line-instruc…
Browse files Browse the repository at this point in the history
…tions

Fix escaped new line in instructions
  • Loading branch information
ianjennings authored Oct 1, 2024
2 parents aa3ae26 + ede7ab5 commit 0a2d364
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 20 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ jobs:
uses: actions/checkout@v3
- uses: ./
with:
version: windows-release
prompt: |
1. open youtube
2. find a cat video
3. quit the browser
4. /summarize
os: windows
prerun: |
npm install dashcam-chrome --save
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --load-extension=./node_modules/dashcam-chrome/build/ 1>/dev/null 2>&1 &
cd $env:TEMP
npm init -y
npm install dashcam-chrome
Start-Process "C:/Program Files/Google/Chrome/Application/chrome.exe" -ArgumentList "--start-maximized","--load-extension=$(pwd)/node_modules/dashcam-chrome/build"
exit
key: ${{ secrets.DASHCAM_WORKSPACE_API }}
env:
Expand Down
16 changes: 7 additions & 9 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40014,11 +40014,7 @@ const waitFor = (ms) => new Promise((r) => setTimeout(r, ms));
console.log(`testdriver@${pgkVersion}`);
console.log(`testdriver-action@${testdriverBranch}`);

let prompt = process.env.IS_DEV
? "open youtube"
: config.input.prompt.replace(/(\r\n|\n)/g, function (match) {
return match === "\n" ? "\\n" : "\\r\\n";
});
let prompt = process.env.IS_DEV ? "open youtube" : config.input.prompt;

console.log("");
console.log(chalk.green("Inputs"));
Expand All @@ -40034,16 +40030,20 @@ const waitFor = (ms) => new Promise((r) => setTimeout(r, ms));
console.log(chalk.yellow("prTestFilename:"), prTestFilename);
}
console.log(chalk.yellow("prompt:"));
console.log(prompt.replace(/\\n/g, "\n").replace(/\\r\\n/g, "\r\n"));
console.log(prompt);
console.log(chalk.yellow("prerun:"));
console.log(prerun.replace(/\\n/g, "\n").replace(/\\r\\n/g, "\r\n"));
console.log(prerun);
console.log("");

console.log(chalk.green("TestDriver:"), '"Looking into it..."');
console.log(chalk.green("TestDriver:"), '"I can help ya test that!"');

const personalAccessToken = process.env.GITHUB_TOKEN;

if (personalAccessToken.length) {
console.log(chalk.green("TestDriver:"), '"Access Token Supplied..."');
}

console.log(chalk.green("TestDriver:"), '"Starting my engine..."');

const {
Expand Down Expand Up @@ -40177,8 +40177,6 @@ const waitFor = (ms) => new Promise((r) => setTimeout(r, ms));
console.log(chalk.yellow("Test:"), chalk.red("Fail"));
}

console.log("share link before extraction", shareLink);

let extractedFromMarkdown = extractLink(shareLink);

console.log("");
Expand Down
12 changes: 4 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ const waitFor = (ms) => new Promise((r) => setTimeout(r, ms));
console.log(`testdriver@${pgkVersion}`);
console.log(`testdriver-action@${testdriverBranch}`);

let prompt = process.env.IS_DEV
? "open youtube"
: config.input.prompt.replace(/(\r\n|\n)/g, function (match) {
return match === "\n" ? "\\n" : "\\r\\n";
});
let prompt = process.env.IS_DEV ? "open youtube" : config.input.prompt;

console.log("");
console.log(chalk.green("Inputs"));
Expand All @@ -64,9 +60,9 @@ const waitFor = (ms) => new Promise((r) => setTimeout(r, ms));
console.log(chalk.yellow("prTestFilename:"), prTestFilename);
}
console.log(chalk.yellow("prompt:"));
console.log(prompt.replace(/\\n/g, "\n").replace(/\\r\\n/g, "\r\n"));
console.log(prompt);
console.log(chalk.yellow("prerun:"));
console.log(prerun.replace(/\\n/g, "\n").replace(/\\r\\n/g, "\r\n"));
console.log(prerun);
console.log("");

console.log(chalk.green("TestDriver:"), '"Looking into it..."');
Expand All @@ -75,7 +71,7 @@ const waitFor = (ms) => new Promise((r) => setTimeout(r, ms));
const personalAccessToken = process.env.GITHUB_TOKEN;

if (personalAccessToken.length) {
console.log(chalk.green("TestDriver:"), '"Access Token Supplied..."');
console.log(chalk.green("TestDriver:"), '"Access Token Supplied..."');
}

console.log(chalk.green("TestDriver:"), '"Starting my engine..."');
Expand Down

0 comments on commit 0a2d364

Please sign in to comment.