Skip to content

Commit 44ab8a6

Browse files
authored
[Infrastructure] Updated npm package cache 2024-07-15 (#56802)
* Clear npm cache on each update * Set Node-Externals to main to avoid merge conflicts * Add a warning about merging Node-Externals PR before the main PR can get merged * Updated npm package cache 2024-07-15
1 parent a5c1b26 commit 44ab8a6

File tree

3 files changed

+2512
-733
lines changed

3 files changed

+2512
-733
lines changed

eng/scripts/update-npm-dependencies.ps1

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
param (
55
[switch]$WhatIf,
6-
[switch]$SkipPullRequestCreation
6+
[switch]$SkipPullRequestCreation,
7+
[switch]$SkipClearCache
78
)
89

910
$ErrorActionPreference = "Stop"
@@ -20,6 +21,12 @@ if (-not $WhatIf) {
2021
Remove-Item .\package-lock.json
2122
}
2223

24+
if (-not $SkipClearCache -and -not $WhatIf) {
25+
Write-Host "Clearing the npm cache"
26+
Remove-Item -Recurse -Force "$PWD/src/submodules/Node-Externals/cache"
27+
New-Item -ItemType Directory -Path "$PWD/src/submodules/Node-Externals/cache"
28+
}
29+
2330
try {
2431
Get-Command vsts-npm-auth -CommandType ExternalScript
2532
Write-Host "vsts-npm-auth is already installed"
@@ -97,7 +104,7 @@ else {
97104
git branch --set-upstream-to=origin/main
98105
git push origin $branchName`:$branchName --force;
99106
gh repo set-default dotnet/Node-Externals
100-
gh pr create --base main --head "infrastructure/update-npm-package-cache-$(Get-Date -Format 'yyyy-MM-dd')" --title "[Infrastructure] Updated npm package cache $(Get-Date -Format 'yyyy-MM-dd')" --body ""
107+
gh pr create --base main --head "infrastructure/update-npm-package-cache-$(Get-Date -Format 'yyyy-MM-dd')" --title "[Infrastructure] Updated npm package cache $(Get-Date -Format 'yyyy-MM-dd')" --body "Do not merge this PR until the one in aspnetcore passes all checks."
101108
}
102109

103110
## Navigate to the root of the repository

0 commit comments

Comments
 (0)