-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port over the fix from #1544 and share code so these scripts don't get out of sync again.
- Loading branch information
1 parent
652709d
commit b8a6278
Showing
3 changed files
with
20 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,17 +7,9 @@ if [ ! -z "$(git status --porcelain)" ]; then | |
>&2 echo "Failed: Repo should be clean before testing!" | ||
exit 1 | ||
fi | ||
# When updating this, make sure to update the npm version in | ||
# `.github/workflows/update-dependencies.yml` too. | ||
sudo npm install --force -g [email protected] | ||
|
||
# clean the npm cache to ensure we don't have any files owned by root | ||
sudo npm cache clean --force | ||
"$(dirname "$0")/update-node-modules.sh" check-only | ||
|
||
# Reinstall modules and then clean to remove absolute paths | ||
# Use 'npm ci' instead of 'npm install' as this is intended to be reproducible | ||
npm ci | ||
npm run removeNPMAbsolutePaths | ||
# Check that repo is still clean | ||
if [ ! -z "$(git status --porcelain)" ]; then | ||
# If we get a fail here then the PR needs attention | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
if [ "$1" != "update" && "$1" != "check-only" ]; then | ||
>&2 echo "Failed: Invalid argument. Must be 'update' or 'check-only'" | ||
exit 1 | ||
fi | ||
|
||
sudo npm install --force -g [email protected] | ||
|
||
# clean the npm cache to ensure we don't have any files owned by root | ||
sudo npm cache clean --force | ||
|
||
if [ "$1" = "update" ]; then | ||
npm install | ||
fi | ||
|
||
# Reinstall modules and then clean to remove absolute paths | ||
# Use 'npm ci' instead of 'npm install' as this is intended to be reproducible | ||
npm ci | ||
npm run removeNPMAbsolutePaths |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,12 +27,7 @@ jobs: | |
run: | | ||
git fetch origin "$BRANCH" --depth=1 | ||
git checkout "origin/$BRANCH" | ||
# When updating this, make sure to update the npm version in | ||
# `.github/workflows/script/check-node-modules.sh` too. | ||
sudo npm install --force -g [email protected] | ||
npm install | ||
npm ci | ||
npm run removeNPMAbsolutePaths | ||
.github/workflows/script/update-node-modules.sh update | ||
if [ ! -z "$(git status --porcelain)" ]; then | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "github-actions[bot]" | ||
|