Skip to content

Commit 74ad226

Browse files
Update buddy-bot.yml
1 parent 07e338a commit 74ad226

File tree

1 file changed

+25
-12
lines changed

1 file changed

+25
-12
lines changed

.github/workflows/buddy-bot.yml

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@ jobs:
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') != '' }}
@@ -166,8 +164,6 @@ jobs:
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
@@ -249,8 +245,6 @@ jobs:
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') != '' }}
@@ -358,8 +352,6 @@ jobs:
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

0 commit comments

Comments
 (0)