File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,17 +7,9 @@ if [ ! -z "$(git status --porcelain)" ]; then
77 >&2 echo " Failed: Repo should be clean before testing!"
88 exit 1
99fi
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
1310
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
1612
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
2113# Check that repo is still clean
2214if [ ! -z " $( git status --porcelain) " ]; then
2315 # 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 2727 run : |
2828 git fetch origin "$BRANCH" --depth=1
2929 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
3631 if [ ! -z "$(git status --porcelain)" ]; then
3732 git config --global user.email "github-actions@github.com"
3833 git config --global user.name "github-actions[bot]"
You can’t perform that action at this time.
0 commit comments