ReviewOS

also looking at this

stacks/buddy

ci: dogfood the checked-out source, and smoke the PR's own CLI without secrets

#1445
Merged glennmichael123 wants to merge ci/dogfood-main into main
2 files +51 -9
.github/workflows/buddy.ymlmodified+20-9
Changes to .github/workflows/buddy.yml
@@ -1,5 +1,8 @@
11name: Buddy
22
3# Dogfood: every job runs the checked-out source (bun ./bin/cli.ts), never the
4# published package — merged changes are exercised by the next scheduled run.
5
36on:
47 # Rebase checkbox: fires instantly when a PR body is edited (e.g. checkbox ticked).
58 # No polling needed — this replaces the old every-minute cron for rebase detection.
@@ -155,6 +158,10 @@ jobs:
155158 with:
156159 token: ${{ secrets.GITHUB_TOKEN }}
157160 fetch-depth: 0 # Fetch full history for rebasing
161 # Pinned: this job also runs on pull_request:edited, where the default
162 # checkout is the PR merge commit — never run PR-modified code in a
163 # job whose environment holds BUDDY_TOKEN.
164 ref: main
158165 persist-credentials: true
159166
160167 - name: Setup Bun
@@ -193,6 +200,10 @@ jobs:
193200 with:
194201 token: ${{ secrets.GITHUB_TOKEN }}
195202 fetch-depth: 0
203 # Pinned: this job also runs on pull_request:edited, where the default
204 # checkout is the PR merge commit — never run PR-modified code in a
205 # job whose environment holds BUDDY_TOKEN.
206 ref: main
196207 persist-credentials: true
197208
198209 - name: Setup Bun
@@ -233,10 +244,10 @@ jobs:
233244
234245 if [ "$" = "true" ]; then
235246 echo "📋 Running in DRY RUN mode..."
236 bunx @buddysh/buddy update-check --dry-run --verbose
247 bun ./bin/cli.ts update-check --dry-run --verbose
237248 else
238249 echo "🔄 Running in LIVE mode..."
239 bunx @buddysh/buddy update-check --verbose
250 bun ./bin/cli.ts update-check --verbose
240251 fi
241252
242253 env:
@@ -326,15 +337,15 @@ jobs:
326337
327338 if [ "$PACKAGES" != "" ]; then
328339 if [ "$VERBOSE" = "true" ]; then
329 bunx @buddysh/buddy update --packages "$PACKAGES" --verbose
340 bun ./bin/cli.ts update --packages "$PACKAGES" --verbose
330341 else
331 bunx @buddysh/buddy update --packages "$PACKAGES"
342 bun ./bin/cli.ts update --packages "$PACKAGES"
332343 fi
333344 else
334345 if [ "$VERBOSE" = "true" ]; then
335 bunx @buddysh/buddy update --strategy "$STRATEGY" --verbose
346 bun ./bin/cli.ts update --strategy "$STRATEGY" --verbose
336347 else
337 bunx @buddysh/buddy update --strategy "$STRATEGY"
348 bun ./bin/cli.ts update --strategy "$STRATEGY"
338349 fi
339350 fi
340351
@@ -447,7 +458,7 @@ jobs:
447458 set -e # Exit on any error
448459
449460 # Build the command
450 COMMAND="bunx @buddysh/buddy dashboard"
461 COMMAND="bun ./bin/cli.ts dashboard"
451462
452463 if [ "$TITLE" != "" ]; then
453464 COMMAND="$COMMAND --title \"$TITLE\""
@@ -470,9 +481,9 @@ jobs:
470481 # Run scan to show what would be included
471482 echo "🔍 Scanning for dependencies that would be included:"
472483 if [ "$VERBOSE" = "true" ]; then
473 bunx @buddysh/buddy scan --verbose
484 bun ./bin/cli.ts scan --verbose
474485 else
475 bunx @buddysh/buddy scan
486 bun ./bin/cli.ts scan
476487 fi
477488 else
478489 echo "🚀 Executing dashboard update:"
.github/workflows/ci.ymlmodified+31-0
Changes to .github/workflows/ci.yml
@@ -110,6 +110,37 @@ jobs:
110110 - name: Check docs against source
111111 run: bun run check:docs
112112
113 # Dogfood smoke: the PR's own code runs its own review, with a read-only
114 # token and no API key. Catches a broken command surface before merge
115 # without putting PR-modified code near secrets.
116 buddy-smoke:
117 if: github.event_name == 'pull_request'
118 runs-on: ubuntu-latest
119 permissions:
120 contents: read
121
122 steps:
123 - uses: actions/checkout@v6
124 with:
125 fetch-depth: 0 # the branch review diffs against origin/main
126
127 - name: Install Bun
128 uses: oven-sh/setup-bun@v2.2.0
129
130 - name: Use cached node_modules
131 uses: actions/cache@v5.0.4
132 with:
133 path: node_modules
134 key: node-modules-${{ hashFiles('**/bun.lock') }}
135 restore-keys: |
136 node-modules-
137
138 - name: Install Dependencies
139 run: bun install
140
141 - name: Review this branch with its own code
142 run: bun ./bin/cli.ts review --branch --base origin/main --light --format github
143
113144 publish-commit:
114145 needs: [lint, typecheck, test, check-docs]
115146 runs-on: ubuntu-latest