-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 1.73 KB
/
update-dependencies.yml
File metadata and controls
61 lines (52 loc) · 1.73 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Generated by Claude Sonnet 4 AI model
name: Update Dependencies
on:
schedule:
# Run every Sunday at 6 AM UTC
- cron: '0 6 * * 0'
workflow_dispatch: # Allow manual trigger
jobs:
update-dependencies:
name: Update Dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '20.x'
cache: 'npm'
- name: Check for outdated packages
id: outdated
run: |
npm outdated --json > outdated.json || true
if [ -s outdated.json ]; then
echo "has_updates=true" >> $GITHUB_OUTPUT
else
echo "has_updates=false" >> $GITHUB_OUTPUT
fi
- name: Update dependencies
if: steps.outdated.outputs.has_updates == 'true'
run: |
npm update
- name: Run tests after update
if: steps.outdated.outputs.has_updates == 'true'
run: |
npm run quality-check
- name: Create Pull Request
if: steps.outdated.outputs.has_updates == 'true'
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'chore: update dependencies'
title: 'chore: automated dependency updates'
body: |
This PR contains automated dependency updates.
- Dependencies have been updated to their latest compatible versions
- All tests and quality checks have passed
- Please review the changes before merging
branch: automated-dependency-updates
delete-branch: true