npm install-test support (#1468)

This commit is contained in:
laurentsimon 2022-01-11 16:34:19 -08:00 committed by GitHub
parent 460d34aa2d
commit 531561c8f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 7 deletions

View File

@ -240,7 +240,7 @@ func TestGithubWorkflowPkgManagerPinning(t *testing.T) {
expected: scut.TestReturn{
Error: nil,
Score: checker.MinResultScore,
NumberOfWarn: 25,
NumberOfWarn: 26,
NumberOfInfo: 0,
NumberOfDebug: 0,
},
@ -858,7 +858,7 @@ func TestDockerfileScriptDownload(t *testing.T) {
expected: scut.TestReturn{
Error: nil,
Score: checker.MinResultScore,
NumberOfWarn: 36,
NumberOfWarn: 37,
NumberOfInfo: 0,
NumberOfDebug: 0,
},
@ -1022,7 +1022,7 @@ func TestShellScriptDownload(t *testing.T) {
expected: scut.TestReturn{
Error: nil,
Score: checker.MinResultScore,
NumberOfWarn: 33,
NumberOfWarn: 34,
NumberOfInfo: 0,
NumberOfDebug: 0,
},

View File

@ -398,13 +398,12 @@ func isNpmUnpinnedDownload(cmd []string) bool {
return false
}
// `npm install` will automatically look up the
// package.json and package-lock.json, so we don't flag it.
for i := 1; i < len(cmd); i++ {
// Search for get/install/update commands.
// `npm ci` wil verify all hashes are present.
if strings.EqualFold(cmd[i], "install") ||
strings.EqualFold(cmd[i], "i") ||
strings.EqualFold(cmd[i], "install-test") ||
strings.EqualFold(cmd[i], "update") {
return true
}

View File

@ -79,4 +79,6 @@ RUN npm i -g typescript
RUN npm install
RUN npm install -g
RUN npm i
RUN npm ci
RUN npm ci
RUN npm install-test
RUN npm install-ci-test

View File

@ -44,6 +44,10 @@ jobs:
run: npm i -g typescript
- name:
run: npm ci
- name:
run: |
npm install-test
npm install-ci-test
- name:
run: go get github.com/org/name@some_tag
- name:

View File

@ -81,4 +81,6 @@ npm i -g typescript
npm install
npm install -g
npm i
npm ci
npm ci
npm install-test
npm install-ci-test