File tree Expand file tree Collapse file tree 3 files changed +20
-15
lines changed Expand file tree Collapse file tree 3 files changed +20
-15
lines changed Original file line number Diff line number Diff line change @@ -7,17 +7,9 @@ if [ ! -z "$(git status --porcelain)" ]; then
7
7
>&2 echo " Failed: Repo should be clean before testing!"
8
8
exit 1
9
9
fi
10
- # When updating this, make sure to update the npm version in
11
- # `.github/workflows/update-dependencies.yml` too.
12
- sudo npm install --force -g npm@9.2.0
13
10
14
- # clean the npm cache to ensure we don't have any files owned by root
15
- sudo npm cache clean --force
11
+ " $( dirname " $0 " ) /update-node-modules.sh" check-only
16
12
17
- # Reinstall modules and then clean to remove absolute paths
18
- # Use 'npm ci' instead of 'npm install' as this is intended to be reproducible
19
- npm ci
20
- npm run removeNPMAbsolutePaths
21
13
# Check that repo is still clean
22
14
if [ ! -z " $( git status --porcelain) " ]; then
23
15
# If we get a fail here then the PR needs attention
Original file line number Diff line number Diff line change
1
+ if [ " $1 " != " update" && " $1 " != " check-only" ]; then
2
+ >&2 echo " Failed: Invalid argument. Must be 'update' or 'check-only'"
3
+ exit 1
4
+ fi
5
+
6
+ sudo npm install --force -g npm@9.2.0
7
+
8
+ # clean the npm cache to ensure we don't have any files owned by root
9
+ sudo npm cache clean --force
10
+
11
+ if [ " $1 " = " update" ]; then
12
+ npm install
13
+ fi
14
+
15
+ # Reinstall modules and then clean to remove absolute paths
16
+ # Use 'npm ci' instead of 'npm install' as this is intended to be reproducible
17
+ npm ci
18
+ npm run removeNPMAbsolutePaths
Original file line number Diff line number Diff line change 27
27
run : |
28
28
git fetch origin "$BRANCH" --depth=1
29
29
git checkout "origin/$BRANCH"
30
- # When updating this, make sure to update the npm version in
31
- # `.github/workflows/script/check-node-modules.sh` too.
32
- sudo npm install --force -g npm@9.2.0
33
- npm install
34
- npm ci
35
- npm run removeNPMAbsolutePaths
30
+ .github/workflows/script/update-node-modules.sh update
36
31
if [ ! -z "$(git status --porcelain)" ]; then
37
32
git config --global user.email "github-actions@github.com"
38
33
git config --global user.name "github-actions[bot]"
You can’t perform that action at this time.
0 commit comments