Skip to content

Commit 1a1e30f

Browse files
chore: add auto-update workflow for dependencies
1 parent 2357cc4 commit 1a1e30f

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

.github/workflows/auto-update.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Auto-update dependencies
2+
3+
on:
4+
schedule:
5+
# Every day at 02:00 UTC
6+
- cron: '0 2 * * *'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
jobs:
14+
update-dependencies:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Check out Git repository
19+
uses: actions/checkout@v4
20+
21+
- name: Install Node.js and Yarn
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 22
25+
26+
- name: yarn install
27+
run: yarn install
28+
29+
- name: Update dependencies
30+
run: |
31+
npm install -g npm-check-updates
32+
ncu -u --target minor
33+
yarn install
34+
35+
- name: Create Pull Request
36+
id: create-pr
37+
uses: peter-evans/create-pull-request@v5
38+
with:
39+
token: ${{ secrets.PAT_TOKEN }}
40+
commit-message: 'chore: update dependencies'
41+
title: 'chore: update dependencies'
42+
body: |
43+
Automated dependency update.
44+
45+
This PR updates all dependencies in `package.json` and `yarn.lock`.
46+
47+
Please review and merge if all checks pass.
48+
branch: chore/update-dependencies
49+
delete-branch: true
50+
51+
- name: Enable auto-merge
52+
if: steps.create-pr.outputs.pull-request-number
53+
run: |
54+
gh pr merge ${{ steps.create-pr.outputs.pull-request-number }} \
55+
--auto \
56+
--squash \
57+
--delete-branch
58+
env:
59+
GH_TOKEN: ${{ secrets.PAT_TOKEN }}

0 commit comments

Comments
 (0)