Skip to content

Commit bb1094a

Browse files
authored
fix: github action (#15)
* fix: github action * feat: load .env file in puppeteer demo
1 parent 1d9162b commit bb1094a

File tree

6 files changed

+12
-5
lines changed

6 files changed

+12
-5
lines changed

.github/workflows/yaml-scripts-demo.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
output_folder:
1111
description: 'Midscene report directory'
1212
required: true
13-
default: 'yaml-scripts/midscene_run/report/'
13+
default: 'yaml-scripts-demo/midscene_run/report/'
1414
push:
1515
branches:
1616
- main
@@ -29,7 +29,7 @@ jobs:
2929
MIDSCENE_DEBUG_AI_PROFILE: 1
3030
run: |
3131
npm i -g @midscene/cli@${{ github.event.inputs.tag }}
32-
cd yaml-scripts
32+
cd yaml-scripts-demo
3333
midscene ./midscene-scripts/
3434
3535
- name: List directory contents

playwright-demo/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ create `.env` file
66

77
```shell
88
# replace by your own
9-
export OPENAI_API_KEY="YOUR_TOKEN"
9+
OPENAI_API_KEY="YOUR_TOKEN"
1010
```
1111

1212
> e2e command

puppeteer-demo/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
package-lock.json
2+
.env
23

34
# Midscene.js dump files
45
midscene_run/midscene-report

puppeteer-demo/README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
# puppeteer-demo
22

3+
create `.env` file
4+
35
```shell
46
# replace by your own
5-
export OPENAI_API_KEY="sk-abcdefghijklmnopqrstuvwxyz"
7+
OPENAI_API_KEY="YOUR_TOKEN"
68
```
79

10+
run demo
11+
812
```bash
913
npm install
1014

puppeteer-demo/demo.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import puppeteer from "puppeteer";
22
import os from "node:os";
33
import { PuppeteerAgent } from "@midscene/web/puppeteer";
4+
import "dotenv/config";
45

56
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
67
Promise.resolve(

puppeteer-demo/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"license": "MIT",
1313
"devDependencies": {
1414
"@midscene/web": "latest",
15+
"dotenv": "^16.4.5",
1516
"puppeteer": "^23.4.0",
1617
"tsx": "^4.19.1"
1718
}
18-
}
19+
}

0 commit comments

Comments
 (0)