Skip to content

Commit 8ca3d25

Browse files
authored
Merge pull request #144 from GalvinPython/fix/dependabot
2 parents 669b7b7 + a956066 commit 8ca3d25

File tree

2 files changed

+52
-8
lines changed

2 files changed

+52
-8
lines changed

.github/dependabot.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1+
# Moving back to npm for package management rather than bun
2+
# because wow dependabot is so broken for it 😭
3+
# TODO: Labels on package updates after project restructure
4+
15
version: 2
26
updates:
3-
- package-ecosystem: "bun"
7+
- package-ecosystem: "npm"
48
directory: "/"
59
schedule:
610
interval: "weekly"
7-
assignees:
8-
- "GalvinPython"
911
target-branch: "dev"
1012

11-
- package-ecosystem: "bun"
13+
- package-ecosystem: "npm"
1214
directory: "/web"
1315
schedule:
1416
interval: "weekly"
15-
assignees:
16-
- "GalvinPython"
1717
target-branch: "dev"
18-
labels: ["dependencies", "javascript", "component: web"]
1918

2019
- package-ecosystem: "cargo"
2120
directory: "/api"
2221
schedule:
23-
interval: "weekly"
22+
interval: "weekly"
23+
target-branch: "dev"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Update bun.lock
2+
3+
on:
4+
pull_request:
5+
branches: [main, dev]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
update-bun-lock:
12+
name: "Update bun.lock"
13+
runs-on: ubuntu-latest
14+
if: github.actor == 'dependabot[bot]'
15+
steps:
16+
- name: Set up Bun
17+
uses: oven-sh/setup-bun@v2
18+
19+
- name: Check out repository
20+
uses: actions/checkout@v4
21+
22+
- name: Install dependencies with Bun
23+
run: bun install
24+
25+
- name: Check for changes
26+
id: git_status
27+
run: |
28+
git add bun.lock
29+
if [ -z "$(git status --porcelain)" ]; then
30+
echo "No changes to bun.lock"
31+
echo "changes_detected=false" >> "$GITHUB_OUTPUT"
32+
else
33+
echo "Changes detected to bun.lock"
34+
echo "changes_detected=true" >> "$GITHUB_OUTPUT"
35+
fi
36+
37+
- name: Commit and push changes to bun.lock
38+
if: steps.git_status.outputs.changes_detected == 'true'
39+
run: |
40+
git config --global user.name 'github-actions[bot]'
41+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
42+
git commit -m "Update bun.lock (via GitHub Actions)"
43+
git pull --rebase origin ${{ github.head_ref }}
44+
git push origin ${{ github.head_ref }}

0 commit comments

Comments
 (0)