Skip to content

Commit 25d341a

Browse files
committed
chore: update tools
1 parent 67f8a7a commit 25d341a

File tree

4 files changed

+160
-291
lines changed

4 files changed

+160
-291
lines changed

.github/workflows/buddy-bot.yml

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ env:
6262
# Create a PAT at: https://github.com/settings/tokens
6363
# Add it as a repository secret named 'BUDDY_BOT_TOKEN'
6464
# If BUDDY_BOT_TOKEN is not available, falls back to GITHUB_TOKEN (limited permissions)
65-
GITHUB_TOKEN: ${{ secrets.BUDDY_BOT_TOKEN || secrets.GITHUB_TOKEN }}
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6666
BUDDY_BOT_TOKEN: ${{ secrets.BUDDY_BOT_TOKEN }}
6767

6868
permissions:
@@ -121,14 +121,12 @@ jobs:
121121
- name: Checkout repository
122122
uses: actions/checkout@v4
123123
with:
124-
token: ${{ secrets.BUDDY_BOT_TOKEN || secrets.GITHUB_TOKEN }}
124+
token: ${{ secrets.GITHUB_TOKEN }}
125125
fetch-depth: 0 # Fetch full history for rebasing
126126
persist-credentials: true
127127

128128
- name: Setup Bun
129129
uses: oven-sh/setup-bun@v2
130-
with:
131-
bun-version: latest
132130

133131
- name: Setup PHP and Composer (if needed)
134132
if: ${{ hashFiles('composer.json') != '' }}
@@ -160,14 +158,12 @@ jobs:
160158
- name: Checkout repository
161159
uses: actions/checkout@v4
162160
with:
163-
token: ${{ secrets.BUDDY_BOT_TOKEN || secrets.GITHUB_TOKEN }}
161+
token: ${{ secrets.GITHUB_TOKEN }}
164162
fetch-depth: 0
165163
persist-credentials: true
166164

167165
- name: Setup Bun
168166
uses: oven-sh/setup-bun@v2
169-
with:
170-
bun-version: latest
171167

172168
- name: Install dependencies
173169
run: bun install
@@ -211,7 +207,7 @@ jobs:
211207
fi
212208
213209
env:
214-
GITHUB_TOKEN: ${{ secrets.BUDDY_BOT_TOKEN || secrets.GITHUB_TOKEN }}
210+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
215211
BUDDY_BOT_TOKEN: ${{ secrets.BUDDY_BOT_TOKEN }}
216212

217213
- name: Create check summary
@@ -231,7 +227,7 @@ jobs:
231227
fi
232228
233229
echo "" >> $GITHUB_STEP_SUMMARY
234-
echo "📋 View detailed logs above for check results (rebase requests and auto-closing)." >> $GITHUB_STEP_SUMMARY
230+
echo "📋 View detailed logs above for check results (rebase requests, auto-closing, and branch cleanup)." >> $GITHUB_STEP_SUMMARY
235231
236232
# Dependency update job
237233
dependency-update:
@@ -243,14 +239,12 @@ jobs:
243239
- name: Checkout repository
244240
uses: actions/checkout@v4
245241
with:
246-
token: ${{ secrets.BUDDY_BOT_TOKEN || secrets.GITHUB_TOKEN }}
242+
token: ${{ secrets.GITHUB_TOKEN }}
247243
fetch-depth: 0
248244
persist-credentials: true
249245

250246
- name: Setup Bun
251247
uses: oven-sh/setup-bun@v2
252-
with:
253-
bun-version: latest
254248

255249
- name: Setup PHP and Composer (if needed)
256250
if: ${{ hashFiles('composer.json') != '' }}
@@ -311,7 +305,7 @@ jobs:
311305
fi
312306
313307
env:
314-
GITHUB_TOKEN: ${{ secrets.BUDDY_BOT_TOKEN || secrets.GITHUB_TOKEN }}
308+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
315309
BUDDY_BOT_TOKEN: ${{ secrets.BUDDY_BOT_TOKEN }}
316310

317311
- name: Dry run notification
@@ -354,12 +348,10 @@ jobs:
354348
- name: Checkout repository
355349
uses: actions/checkout@v4
356350
with:
357-
token: ${{ secrets.BUDDY_BOT_TOKEN || secrets.GITHUB_TOKEN }}
351+
token: ${{ secrets.GITHUB_TOKEN }}
358352

359353
- name: Setup Bun
360354
uses: oven-sh/setup-bun@v2
361-
with:
362-
bun-version: latest
363355

364356
- name: Install dependencies
365357
run: bun install
@@ -376,6 +368,31 @@ jobs:
376368
echo "Repository: ${{ github.repository }}"
377369
echo "Branch: ${{ github.ref_name }}"
378370
371+
- name: Pre-flight dashboard check
372+
if: ${{ github.event.inputs.dry_run != 'true' }}
373+
run: |
374+
echo "🔍 Pre-flight check: Looking for existing dashboard issues..."
375+
376+
# Check for existing dashboard issues to prevent duplicates
377+
if command -v gh &> /dev/null; then
378+
EXISTING_DASHBOARDS=$(gh issue list --label "dashboard,dependencies" --state open --json number,title,url --jq length 2>/dev/null || echo "0")
379+
echo "Found $EXISTING_DASHBOARDS existing dashboard issue(s)"
380+
381+
if [ "$EXISTING_DASHBOARDS" -gt 1 ]; then
382+
echo "⚠️ WARNING: Multiple dashboard issues detected!"
383+
gh issue list --label "dashboard,dependencies" --state open --json number,title,url --jq '.[] | " - #\(.number): \(.title) - \(.url)"' 2>/dev/null || true
384+
echo ""
385+
echo "🔧 Buddy Bot will attempt to update the most recent one and may close duplicates"
386+
elif [ "$EXISTING_DASHBOARDS" -eq 1 ]; then
387+
DASHBOARD_INFO=$(gh issue list --label "dashboard,dependencies" --state open --json number,title,url --jq '.[0] | "#\(.number): \(.title) - \(.url)"' 2>/dev/null || echo "Found 1 dashboard")
388+
echo "✅ Found existing dashboard: $DASHBOARD_INFO"
389+
else
390+
echo "ℹ️ No existing dashboard found - a new one will be created"
391+
fi
392+
else
393+
echo "⚠️ GitHub CLI not available - cannot perform pre-flight check"
394+
fi
395+
379396
- name: Update Dependency Dashboard
380397
run: |
381398
PIN="${{ github.event.inputs.pin || 'true' }}"
@@ -397,10 +414,6 @@ jobs:
397414
# Build the command
398415
COMMAND="bunx buddy-bot dashboard"
399416
400-
if [ "$PIN" = "true" ]; then
401-
COMMAND="$COMMAND --pin"
402-
fi
403-
404417
if [ "$TITLE" != "" ]; then
405418
COMMAND="$COMMAND --title \"$TITLE\""
406419
fi
@@ -434,7 +447,7 @@ jobs:
434447
fi
435448
436449
env:
437-
GITHUB_TOKEN: ${{ secrets.BUDDY_BOT_TOKEN || secrets.GITHUB_TOKEN }}
450+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
438451
BUDDY_BOT_TOKEN: ${{ secrets.BUDDY_BOT_TOKEN }}
439452

440453
- name: Dry run notification

buddy-bot.config.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import type { BuddyBotConfig } from 'buddy-bot'
2+
3+
const config: BuddyBotConfig = {
4+
repository: {
5+
owner: 'stacksjs',
6+
name: 'bun-query-builder',
7+
provider: 'github',
8+
// Uses GITHUB_TOKEN by default
9+
},
10+
dashboard: {
11+
enabled: true,
12+
title: 'Dependency Dashboard',
13+
// issueNumber: undefined, // Auto-generated
14+
},
15+
workflows: {
16+
enabled: true,
17+
outputDir: '.github/workflows',
18+
templates: {
19+
daily: true,
20+
weekly: true,
21+
monthly: true,
22+
},
23+
custom: [],
24+
},
25+
packages: {
26+
strategy: 'all',
27+
ignore: [
28+
// Add packages to ignore here
29+
// Example: '@types/node', 'eslint'
30+
],
31+
ignorePaths: [
32+
// Add file/directory paths to ignore using glob patterns
33+
// Example: 'packages/test-*/**', '**/*test-envs/**', 'apps/legacy/**'
34+
],
35+
},
36+
verbose: false,
37+
}
38+
39+
export default config

0 commit comments

Comments
 (0)