Skip to content

Commit f6eefc5

Browse files
authored
retry npm install/view for appsec and plugins tests (#5434)
1 parent b52b7fa commit f6eefc5

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

.github/workflows/appsec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ jobs:
257257
runs-on: ubuntu-latest
258258
steps:
259259
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
260-
- run: yarn install
260+
- uses: ./.github/actions/install
261261
- uses: ./.github/actions/node/oldest-maintenance-lts
262262
- run: yarn test:integration:appsec
263263
- uses: ./.github/actions/node/active-lts

scripts/install_plugin_modules.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,11 @@ async function getVersionList (name) {
161161
return list
162162
}
163163

164-
function npmView (input) {
164+
function npmView (input, retry = true) {
165165
return new Promise((resolve, reject) => {
166166
childProcess.exec(`npm view ${input} --json`, (err, stdout) => {
167167
if (err) {
168-
reject(err)
169-
return
168+
return retry ? npmView(input, false).then(resolve, reject) : reject(err)
170169
}
171170
resolve(JSON.parse(stdout.toString('utf8')))
172171
})

0 commit comments

Comments
 (0)