Skip to content

Commit 53e6419

Browse files
authored
Fix roocode.com Vercel preview on PR open (#4916)
1 parent b6bbb1e commit 53e6419

File tree

4 files changed

+50
-12
lines changed

4 files changed

+50
-12
lines changed

.github/workflows/website-preview.yml

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ on:
55
branches-ignore:
66
- main
77
paths:
8-
- 'apps/web-roo-code/**'
8+
- "apps/web-roo-code/**"
9+
pull_request:
10+
paths:
11+
- "apps/web-roo-code/**"
912
workflow_dispatch:
1013

1114
env:
@@ -21,11 +24,11 @@ jobs:
2124
- name: Check if VERCEL_TOKEN exists
2225
id: check
2326
run: |
24-
if [ -n "${{ secrets.VERCEL_TOKEN }}" ]; then
25-
echo "has-vercel-token=true" >> $GITHUB_OUTPUT
26-
else
27-
echo "has-vercel-token=false" >> $GITHUB_OUTPUT
28-
fi
27+
if [ -n "${{ secrets.VERCEL_TOKEN }}" ]; then
28+
echo "has-vercel-token=true" >> $GITHUB_OUTPUT
29+
else
30+
echo "has-vercel-token=false" >> $GITHUB_OUTPUT
31+
fi
2932
3033
preview:
3134
runs-on: ubuntu-latest
@@ -43,4 +46,39 @@ jobs:
4346
- name: Build Project Artifacts
4447
run: npx vercel build --token=${{ secrets.VERCEL_TOKEN }}
4548
- name: Deploy Project Artifacts to Vercel
46-
run: npx vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
49+
id: deploy
50+
run: |
51+
DEPLOYMENT_URL=$(npx vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})
52+
echo "deployment_url=$DEPLOYMENT_URL" >> $GITHUB_OUTPUT
53+
echo "Preview deployed to: $DEPLOYMENT_URL"
54+
55+
- name: Comment PR with preview link
56+
if: github.event_name == 'pull_request'
57+
uses: actions/github-script@v7
58+
with:
59+
script: |
60+
const deploymentUrl = '${{ steps.deploy.outputs.deployment_url }}';
61+
const commentIdentifier = '<!-- roo-preview-comment -->';
62+
63+
const { data: comments } = await github.rest.issues.listComments({
64+
owner: context.repo.owner,
65+
repo: context.repo.repo,
66+
issue_number: context.issue.number,
67+
});
68+
69+
const existingComment = comments.find(comment =>
70+
comment.body.includes(commentIdentifier)
71+
);
72+
73+
if (existingComment) {
74+
return;
75+
}
76+
77+
const comment = commentIdentifier + '\n🚀 **Preview deployed!**\n\nYour changes have been deployed to Vercel:\n\n**Preview URL:** ' + deploymentUrl + '\n\nThis preview will be updated automatically when you push new commits to this PR.';
78+
79+
await github.rest.issues.createComment({
80+
owner: context.repo.owner,
81+
repo: context.repo.repo,
82+
issue_number: context.issue.number,
83+
body: comment
84+
});

apps/web-evals/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.0",
44
"type": "module",
55
"scripts": {
6-
"lint": "next lint",
6+
"lint": "next lint --max-warnings 0",
77
"check-types": "tsc -b",
88
"dev": "scripts/check-services.sh && next dev",
99
"format": "prettier --write src",

apps/web-roo-code/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.0",
44
"type": "module",
55
"scripts": {
6-
"lint": "next lint",
6+
"lint": "next lint --max-warnings 0",
77
"check-types": "tsc --noEmit",
88
"dev": "next dev",
99
"build": "next build",

apps/web-roo-code/src/app/privacy/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ export default function Privacy() {
1717
<p className="text-muted-foreground">Last Updated: June 19, 2025</p>
1818

1919
<p className="lead">
20-
This Privacy Policy explains how Roo Code, Inc. ("Roo Code," "we," "our," or "us") collects,
21-
uses, and shares information when you:
20+
This Privacy Policy explains how Roo Code, Inc. (&quot;Roo Code,&quot; &quot;we,&quot;
21+
&quot;our,&quot; or &quot;us&quot;) collects, uses, and shares information when you:
2222
</p>
2323
<ul className="lead">
2424
<li>
@@ -149,7 +149,7 @@ export default function Privacy() {
149149
</li>
150150
</ul>
151151

152-
<h2 className="mt-12 text-2xl font-bold">3. Where Your Data Goes (And Doesn't)</h2>
152+
<h2 className="mt-12 text-2xl font-bold">3. Where Your Data Goes (And Doesn&apos;t)</h2>
153153

154154
<div className="overflow-x-auto">
155155
<table className="min-w-full border-collapse border border-border">

0 commit comments

Comments
 (0)