Skip to content

Commit 5be2825

Browse files
brabojclaude
andcommitted
revert: remove Lighthouse PR comment feature
Keep simple workflow — scores available via artifacts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 61e016d commit 5be2825

1 file changed

Lines changed: 0 additions & 58 deletions

File tree

.github/workflows/lighthouse.yml

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ on:
88
jobs:
99
lighthouse:
1010
runs-on: ubuntu-latest
11-
permissions:
12-
pull-requests: write
1311
steps:
1412
- name: Checkout
1513
uses: actions/checkout@v4
@@ -33,63 +31,7 @@ jobs:
3331
run: npm run build
3432

3533
- name: Lighthouse CI
36-
id: lhci
3734
uses: treosh/lighthouse-ci-action@v12
3835
with:
3936
configPath: ./lighthouserc.json
4037
uploadArtifacts: true
41-
42-
- name: Post Lighthouse scores to PR
43-
uses: actions/github-script@v7
44-
with:
45-
script: |
46-
const fs = require('fs');
47-
const path = require('path');
48-
const dir = '.lighthouseci';
49-
const files = fs.readdirSync(dir).filter(f => f.endsWith('.json') && !f.startsWith('manifest'));
50-
const rows = [];
51-
for (const f of files) {
52-
const raw = JSON.parse(fs.readFileSync(path.join(dir, f), 'utf8'));
53-
const r = raw.lhr || raw;
54-
if (!r.categories) continue;
55-
const rawUrl = r.finalDisplayedUrl || r.finalUrl || r.requestedUrl || '';
56-
const pagePath = rawUrl.startsWith('http') ? new URL(rawUrl).pathname : rawUrl || f;
57-
const scores = r.categories;
58-
const fmt = (cat) => {
59-
if (!scores[cat]) return 'N/A';
60-
const s = Math.round(scores[cat].score * 100);
61-
const icon = s >= 90 ? '🟢' : s >= 50 ? '🟠' : '🔴';
62-
return `${icon} ${s}`;
63-
};
64-
rows.push(`| ${pagePath} | ${fmt('performance')} | ${fmt('accessibility')} | ${fmt('best-practices')} | ${fmt('seo')} |`);
65-
}
66-
const body = [
67-
'## Lighthouse Results',
68-
'',
69-
'| Page | Performance | Accessibility | Best Practices | SEO |',
70-
'|------|------------|---------------|----------------|-----|',
71-
...rows,
72-
'',
73-
'_Scores: 🟢 90+ · 🟠 50-89 · 🔴 0-49_'
74-
].join('\n');
75-
const { data: comments } = await github.rest.issues.listComments({
76-
owner: context.repo.owner,
77-
repo: context.repo.repo,
78-
issue_number: context.issue.number,
79-
});
80-
const existing = comments.find(c => c.body.includes('## Lighthouse Results'));
81-
if (existing) {
82-
await github.rest.issues.updateComment({
83-
owner: context.repo.owner,
84-
repo: context.repo.repo,
85-
comment_id: existing.id,
86-
body,
87-
});
88-
} else {
89-
await github.rest.issues.createComment({
90-
owner: context.repo.owner,
91-
repo: context.repo.repo,
92-
issue_number: context.issue.number,
93-
body,
94-
});
95-
}

0 commit comments

Comments
 (0)