Skip to content

Commit 792e4c6

Browse files
committed
chore: add buddy bot
1 parent bfdfa41 commit 792e4c6

File tree

4 files changed

+179
-6
lines changed

4 files changed

+179
-6
lines changed

.github/workflows/buddy-bot-daily.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ on:
66
workflow_dispatch: # Allow manual triggering
77
inputs:
88
strategy:
9-
description: Update strategy
9+
description: 'Update strategy'
1010
required: false
11-
default: patch
11+
default: 'patch'
1212
type: choice
1313
options:
1414
- all
1515
- major
1616
- minor
1717
- patch
1818
dry_run:
19-
description: Dry run (preview only)
19+
description: 'Dry run (preview only)'
2020
required: false
2121
default: false
2222
type: boolean
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Monthly Dependency Updates
2+
3+
on:
4+
schedule:
5+
- cron: '0 2 1 * *'
6+
workflow_dispatch: # Allow manual triggering
7+
inputs:
8+
strategy:
9+
description: 'Update strategy'
10+
required: false
11+
default: 'major'
12+
type: choice
13+
options:
14+
- all
15+
- major
16+
- minor
17+
- patch
18+
dry_run:
19+
description: 'Dry run (preview only)'
20+
required: false
21+
default: false
22+
type: boolean
23+
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
27+
permissions:
28+
contents: write
29+
pull-requests: write
30+
issues: write
31+
actions: read
32+
checks: read
33+
statuses: read
34+
35+
jobs:
36+
dependency-updates:
37+
runs-on: ubuntu-latest
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v4
42+
with:
43+
token: ${{ secrets.GITHUB_TOKEN }}
44+
45+
- name: Setup Bun
46+
uses: oven-sh/setup-bun@v2
47+
with:
48+
bun-version: latest
49+
50+
- name: Install dependencies
51+
run: bun install
52+
53+
- name: Build buddy-bot
54+
run: bun run build
55+
56+
- name: Run Buddy dependency updates
57+
run: |
58+
STRATEGY="${{ github.event.inputs.strategy || 'major' }}"
59+
DRY_RUN="${{ github.event.inputs.dry_run || 'false' }}"
60+
61+
if [ "$DRY_RUN" = "true" ]; then
62+
./buddy update --strategy "$STRATEGY" --dry-run --verbose
63+
else
64+
./buddy update --strategy "$STRATEGY" --verbose
65+
fi
66+
67+
- name: Auto-merge updates
68+
if: ${{ false }}
69+
run: |
70+
echo "Auto-merge is enabled for this workflow"
71+
72+
# Check if conditions are met for auto-merge
73+
STRATEGY="${{ github.event.inputs.strategy || 'major' }}"
74+
AUTO_MERGE_STRATEGY="squash"
75+
76+
echo "Update strategy: $STRATEGY"
77+
echo "Auto-merge strategy: $AUTO_MERGE_STRATEGY"
78+
79+
# Enable auto-merge for created PRs
80+
# This will be implemented when the PR creation logic is fully integrated
81+
# For now, this step serves as a placeholder and configuration validation
82+
83+
if [ "$STRATEGY" = "patch" ]; then
84+
echo "✅ Patch updates are eligible for auto-merge"
85+
else
86+
echo "ℹ️ Only patch updates are auto-merged by default"
87+
fi
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Weekly Dependency Updates
2+
3+
on:
4+
schedule:
5+
- cron: '0 2 * * 1'
6+
workflow_dispatch: # Allow manual triggering
7+
inputs:
8+
strategy:
9+
description: 'Update strategy'
10+
required: false
11+
default: 'minor'
12+
type: choice
13+
options:
14+
- all
15+
- major
16+
- minor
17+
- patch
18+
dry_run:
19+
description: 'Dry run (preview only)'
20+
required: false
21+
default: false
22+
type: boolean
23+
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
27+
permissions:
28+
contents: write
29+
pull-requests: write
30+
issues: write
31+
actions: read
32+
checks: read
33+
statuses: read
34+
35+
jobs:
36+
dependency-updates:
37+
runs-on: ubuntu-latest
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v4
42+
with:
43+
token: ${{ secrets.GITHUB_TOKEN }}
44+
45+
- name: Setup Bun
46+
uses: oven-sh/setup-bun@v2
47+
with:
48+
bun-version: latest
49+
50+
- name: Install dependencies
51+
run: bun install
52+
53+
- name: Build buddy-bot
54+
run: bun run build
55+
56+
- name: Run Buddy dependency updates
57+
run: |
58+
STRATEGY="${{ github.event.inputs.strategy || 'minor' }}"
59+
DRY_RUN="${{ github.event.inputs.dry_run || 'false' }}"
60+
61+
if [ "$DRY_RUN" = "true" ]; then
62+
./buddy update --strategy "$STRATEGY" --dry-run --verbose
63+
else
64+
./buddy update --strategy "$STRATEGY" --verbose
65+
fi
66+
67+
- name: Auto-merge updates
68+
if: ${{ false }}
69+
run: |
70+
echo "Auto-merge is enabled for this workflow"
71+
72+
# Check if conditions are met for auto-merge
73+
STRATEGY="${{ github.event.inputs.strategy || 'minor' }}"
74+
AUTO_MERGE_STRATEGY="squash"
75+
76+
echo "Update strategy: $STRATEGY"
77+
echo "Auto-merge strategy: $AUTO_MERGE_STRATEGY"
78+
79+
# Enable auto-merge for created PRs
80+
# This will be implemented when the PR creation logic is fully integrated
81+
# For now, this step serves as a placeholder and configuration validation
82+
83+
if [ "$STRATEGY" = "patch" ]; then
84+
echo "✅ Patch updates are eligible for auto-merge"
85+
else
86+
echo "ℹ️ Only patch updates are auto-merged by default"
87+
fi

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767
"stylelint:fix": "bun stylelint --fix",
6868
"stylelint:staged": "bun stylelint --fix",
6969
"fresh": "bunx rimraf node_modules/ bun.lock && bun i",
70-
"changelog": "bun node_modules/@stacksjs/logsmith/dist/bin/cli.js --output CHANGELOG.md --theme github --exclude-authors \"dependabot[bot],github-actions[bot]\" --exclude-types \"chore\" --max-commits 50",
70+
"logsmith": "bun node_modules/@stacksjs/logsmith/dist/bin/cli.js",
71+
"changelog": "bun logsmith --output CHANGELOG.md --theme github --exclude-authors \"dependabot[bot],github-actions[bot]\" --exclude-types \"chore\" --max-commits 50",
7172
"changelog:generate": "bun node_modules/@stacksjs/logsmith/dist/bin/cli.js --output CHANGELOG.md --theme github --exclude-authors \"dependabot[bot],github-actions[bot]\" --exclude-types \"chore\" --max-commits 50",
7273
"changelog:json": "bun node_modules/@stacksjs/logsmith/dist/bin/cli.js --format json --output changelog.json --exclude-types \"chore\" --max-commits 50",
7374
"changelog:html": "bun node_modules/@stacksjs/logsmith/dist/bin/cli.js --format html --output changelog.html --exclude-types \"chore\" --max-commits 50",
@@ -91,12 +92,10 @@
9192
"@stacksjs/gitlint": "^0.1.5",
9293
"@stacksjs/logsmith": "^0.1.2",
9394
"@types/bun": "^1.2.18",
94-
"bumpp": "^10.2.0",
9595
"bumpx": "^0.1.1",
9696
"bun-git-hooks": "^0.2.17",
9797
"bun-plugin-dtsx": "^0.21.12",
9898
"bunfig": "^0.10.1",
99-
"changelogen": "^0.6.2",
10099
"happy-dom": "^18.0.1",
101100
"prettier": "^3.6.2",
102101
"stylelint": "^16.21.1",

0 commit comments

Comments
 (0)