mirror of
https://github.com/ossf/scorecard.git
synced 2024-11-05 05:17:00 +03:00
npm install-test support (#1468)
This commit is contained in:
parent
460d34aa2d
commit
531561c8f4
@ -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,
|
||||
},
|
||||
|
@ -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
|
||||
}
|
||||
|
4
checks/testdata/Dockerfile-pkg-managers
vendored
4
checks/testdata/Dockerfile-pkg-managers
vendored
@ -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
|
@ -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:
|
||||
|
4
checks/testdata/script-pkg-managers
vendored
4
checks/testdata/script-pkg-managers
vendored
@ -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
|
Loading…
Reference in New Issue
Block a user