-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (37 loc) · 1.25 KB
/
dependabot_bun.yml
File metadata and controls
44 lines (37 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Update bun.lock
on:
pull_request:
branches: [main, dev]
permissions:
contents: write
jobs:
update-bun-lock:
name: "Update bun.lock"
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Set up Bun
uses: oven-sh/setup-bun@v2
- name: Check out repository
uses: actions/checkout@v4
- name: Install dependencies with Bun
run: bun install
- name: Check for changes
id: git_status
run: |
git add bun.lock
if [ -z "$(git status --porcelain)" ]; then
echo "No changes to bun.lock"
echo "changes_detected=false" >> "$GITHUB_OUTPUT"
else
echo "Changes detected to bun.lock"
echo "changes_detected=true" >> "$GITHUB_OUTPUT"
fi
- name: Commit and push changes to bun.lock
if: steps.git_status.outputs.changes_detected == 'true'
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git commit -m "Update bun.lock (via GitHub Actions)"
git pull --rebase origin ${{ github.head_ref }}
git push origin ${{ github.head_ref }}