-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (35 loc) · 964 Bytes
/
npm-update.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
36
37
38
39
40
41
42
43
44
45
name: Npm update
on:
workflow_dispatch:
inputs:
skip_audit:
required: false
default: false
type: boolean
schedule:
- cron: '0 2 * * *'
jobs:
Npm-Update:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: |
git config --global user.email "[email protected]"
git config --global user.name "web-ci"
- run: npm ci
- run: npx npm-check-updates -u -t minor
- run: npm install
- run: npm audit fix
if: ${{ !inputs.skip_audit }}
- run: npm test
- run: git add package.json package-lock.json
- name: Commit changes
run: |
# Only commit if there are changes
if ! git diff-index --quiet HEAD; then
git commit -m 'chore(deps): Update packages - minor by github workflow'
fi
- run: git push