Skip to content

Commit

Permalink
Merge pull request #21 from dashcamio/new-exit-code
Browse files Browse the repository at this point in the history
use returned exit code
  • Loading branch information
ianjennings authored Jun 19, 2024
2 parents 567be6b + 2e612ad commit a6c0a0d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ jobs:
uses: actions/checkout@v3
- uses: ./
with:
version: v2.6.0
version: v3.3.8
prompt: |
1. open youtube.
1. open youtube
2. find a cat video
3. quit the browser
4. /summarize
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 &
exit
key: ${{ secrets.DASHCAM_WORKSPACE_API }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FORCE_COLOR: "3"
6 changes: 4 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40104,7 +40104,7 @@ const waitFor = (ms) => new Promise((r) => setTimeout(r, ms));
console.log(chalk.green("TestDriver:"), '"Writing my report..."'.green);

const {
data: { shareLink, oiResult },
data: { shareLink, oiResult, exitcode },
} = await axios.post(
`${baseUrl}/testdriver-artifacts`,
{ workflowId },
Expand All @@ -40116,7 +40116,9 @@ const waitFor = (ms) => new Promise((r) => setTimeout(r, ms));

console.log(chalk.green("TestDriver:"), '"Interpreting results..."'.green);

const isPassed = oiResult.includes("The test passed");
console.log(exitcode)

const isPassed = parseInt(exitcode) === 0;

if (!isPassed) {
core.setFailed(oiResult);
Expand Down
6 changes: 4 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const waitFor = (ms) => new Promise((r) => setTimeout(r, ms));
console.log(chalk.green("TestDriver:"), '"Writing my report..."'.green);

const {
data: { shareLink, oiResult },
data: { shareLink, oiResult, exitcode },
} = await axios.post(
`${baseUrl}/testdriver-artifacts`,
{ workflowId },
Expand All @@ -159,7 +159,9 @@ const waitFor = (ms) => new Promise((r) => setTimeout(r, ms));

console.log(chalk.green("TestDriver:"), '"Interpreting results..."'.green);

const isPassed = oiResult.includes("The test passed");
console.log(exitcode)

const isPassed = parseInt(exitcode) === 0;

if (!isPassed) {
core.setFailed(oiResult);
Expand Down

0 comments on commit a6c0a0d

Please sign in to comment.