-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (63 loc) · 2.17 KB
/
Copy pathprobe.yml
File metadata and controls
71 lines (63 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Selector Health Probe
on:
workflow_dispatch:
schedule:
- cron: '0 8 * * *'
jobs:
probe:
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install probe deps
run: npm install --no-fund --no-audit
- name: Install Playwright browser
run: npx playwright install chromium
- name: Run selector probe
env:
CHATGPT_SESSION_COOKIE: ${{ secrets.CHATGPT_SESSION_COOKIE }}
CLAUDE_SESSION_COOKIE: ${{ secrets.CLAUDE_SESSION_COOKIE }}
TEST_CHATGPT_URL: ${{ secrets.TEST_CHATGPT_URL }}
TEST_CLAUDE_URL: ${{ secrets.TEST_CLAUDE_URL }}
run: npm run probe
- name: Upload probe artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: probe-result
path: probe-result.json
- name: Open breakage issue
if: failure()
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const path = 'probe-result.json';
if (!fs.existsSync(path)) return;
const payload = JSON.parse(fs.readFileSync(path, 'utf8'));
const broken = (payload.results || []).filter(result => (result.broken || []).length);
const titlePlatform = broken.map(item => item.platform).join(', ') || 'unknown';
const title = `[AUTO] Selector breakage detected — ${titlePlatform} @ ${new Date().toISOString().slice(0, 10)}`;
const body = [
'## Probe Result',
'',
'```json',
JSON.stringify(payload, null, 2),
'```',
'',
'Workflow artifact `probe-result` contains the raw result JSON.'
].join('\n');
await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title,
body,
labels: ['selector-broken', 'auto']
});