Skip to content

Commit 61a34c9

Browse files
committed
ci: improve sync-lockfile workflow - use git-auto-commit-action and add bun cache
1 parent 1562669 commit 61a34c9

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

.github/workflows/sync-lockfile.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,21 @@ jobs:
1717
with:
1818
ref: ${{ github.head_ref }}
1919
token: ${{ secrets.GITHUB_TOKEN }}
20+
fetch-depth: 0
2021

2122
- uses: oven-sh/setup-bun@v2
2223

24+
- uses: actions/cache@v4
25+
with:
26+
path: ~/.bun/install/cache
27+
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}
28+
restore-keys: ${{ runner.os }}-bun-
29+
2330
- run: bun install
2431

25-
- name: Commit updated lockfile
26-
run: |
27-
git config user.name "github-actions[bot]"
28-
git config user.email "github-actions[bot]@users.noreply.github.com"
29-
git add bun.lock
30-
if git diff --staged --quiet; then
31-
echo "No lockfile changes, skipping commit"
32-
exit 0
33-
fi
34-
git commit -m "chore: sync bun.lock"
35-
git pull --rebase origin ${{ github.head_ref }}
36-
git push
32+
- uses: stefanzweifel/git-auto-commit-action@v5
33+
with:
34+
commit_message: "chore: sync bun.lock"
35+
file_pattern: bun.lock
36+
commit_user_name: github-actions[bot]
37+
commit_user_email: github-actions[bot]@users.noreply.github.com

0 commit comments

Comments
 (0)