forked from opencast/opencast
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (56 loc) · 1.89 KB
/
auto-update-npm-libraries.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Auto-update npm libraries
# Be carefuly for which modules you activate auto-updates.
# Braking changes *MUST* be caught in the CI or they will cause errors.
# Updating test libraries like eslint should be safe however.
# Perform updates at 3am every day
on:
schedule:
- cron: "0 3 * * *"
jobs:
update-npm-libs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: prepare git
run: |
git config --global user.email '[email protected]'
git config --global user.name 'Update Bot'
- name: use node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: update engage-ui test libraries
working-directory: modules/engage-ui
run: |
npm update --save --dev eslint eslint-plugin-header
npm audit fix || true
git add package.json package-lock.json
- name: update all engage-theodul-* libraries (they only have tests)
working-directory: modules/
run: |
set -ue
for module in $(ls -1 engage-theodul-*/package.json | sed 's_/package.json__')
do
cd "${module}"
rm package-lock.json
npm update --dev
npm audit fix
git add package.json package-lock.json
cd -
done
- name: make sure tests still work
working-directory: modules/engage-theodul-core
run: |
set -ue
for module in $(ls -1 engage-theodul-*/package.json | sed 's_/package.json__')
do
cd "${module}"
npm run eslint
cd -
done
#NB: The || true after the commit ensures that the pipeline doesn't fail
# (and send emails) if there are no updates available
- name: push changes
run: |
git commit -m 'Auto-update npm packages' || true
git push