-
Notifications
You must be signed in to change notification settings - Fork 13
35 lines (29 loc) · 898 Bytes
/
updateNpm.yml
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
name: Update NPM packages
on:
workflow_dispatch:
schedule:
# Run the workflow every week (adjust as needed)
- cron: '0 0 * * 0'
jobs:
update-packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Update NPM packages
run: |
npm install -g npm-check-updates
ncu -u
npm install
- name: Commit changes
run: |
git config --global user.name 'GitHub Actions Bot'
git config --global user.email '[email protected]'
git add package.json package-lock.json README.md
git commit -m "Update NPM packages" || echo "No changes to commit"
git push origin HEAD:${{ github.ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}