Skip to content

Commit 4f82106

Browse files
chore: update dependencies (#227)
1 parent 66be5b0 commit 4f82106

File tree

8 files changed

+57
-39
lines changed

8 files changed

+57
-39
lines changed

.github/workflows/codeql.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ jobs:
4141

4242
steps:
4343
- name: Harden Runner
44-
uses: step-security/harden-runner@1f99358870fe1c846a3ccba386cc2b2246836776 # v2.2.1
44+
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604 # v2.5.0
4545
with:
4646
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
4747

4848
- name: Checkout repository
49-
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
49+
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
5050

5151
# Initializes the CodeQL tools for scanning.
5252
- name: Initialize CodeQL
53-
uses: github/codeql-action/init@0225834cc549ee0ca93cb085b92954821a145866 # v2.3.5
53+
uses: github/codeql-action/init@0ba4244466797eb048eb91a6cd43d5c03ca8bd05 # v2.21.2
5454
with:
5555
languages: ${{ matrix.language }}
5656
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -63,7 +63,7 @@ jobs:
6363
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
6464
# If this step fails, then you should remove it and run the build manually (see below)
6565
- name: Autobuild
66-
uses: github/codeql-action/autobuild@0225834cc549ee0ca93cb085b92954821a145866 # v2.3.5
66+
uses: github/codeql-action/autobuild@0ba4244466797eb048eb91a6cd43d5c03ca8bd05 # v2.21.2
6767

6868
# ℹ️ Command-line programs to run using the OS shell.
6969
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -76,6 +76,6 @@ jobs:
7676
# ./location_of_script_within_repo/buildscript.sh
7777

7878
- name: Perform CodeQL Analysis
79-
uses: github/codeql-action/analyze@0225834cc549ee0ca93cb085b92954821a145866 # v2.3.5
79+
uses: github/codeql-action/analyze@0ba4244466797eb048eb91a6cd43d5c03ca8bd05 # v2.21.2
8080
with:
8181
category: "/language:${{matrix.language}}"

.github/workflows/nodejs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ jobs:
1818
fail-fast: false
1919
steps:
2020
- name: Harden Runner
21-
uses: step-security/harden-runner@1f99358870fe1c846a3ccba386cc2b2246836776 # v2.2.1
21+
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604 # v2.5.0
2222
with:
2323
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
2424

25-
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
25+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
2626
- name: Use Node.js ${{ matrix.node-version }}
27-
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
27+
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
2828
with:
2929
node-version: ${{ matrix.node-version }}
3030
- name: Install dependencies
3131
run: npm install
3232
- name: Run tests
3333
run: npm run coverage
3434
- name: Send coverage report to Codecov
35-
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
35+
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4

.github/workflows/scorecards.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ jobs:
3232

3333
steps:
3434
- name: Harden Runner
35-
uses: step-security/harden-runner@1f99358870fe1c846a3ccba386cc2b2246836776 # v2.2.1
35+
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604 # v2.5.0
3636
with:
3737
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
3838

3939
- name: "Checkout code"
40-
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.1.0
40+
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
4141
with:
4242
persist-credentials: false
4343

4444
- name: "Run analysis"
45-
uses: ossf/scorecard-action@80e868c13c90f172d68d1f4501dee99e2479f7af # v2.1.3
45+
uses: ossf/scorecard-action@08b4669551908b1024bb425080c797723083c031 # v2.2.0
4646
with:
4747
results_file: results.sarif
4848
results_format: sarif
@@ -72,6 +72,6 @@ jobs:
7272

7373
# Upload the results to GitHub's code scanning dashboard.
7474
- name: "Upload to code-scanning"
75-
uses: github/codeql-action/upload-sarif@0225834cc549ee0ca93cb085b92954821a145866 # v2.1.27
75+
uses: github/codeql-action/upload-sarif@0ba4244466797eb048eb91a6cd43d5c03ca8bd05 # v2.21.2
7676
with:
7777
sarif_file: results.sarif

.github/workflows/vis-network.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ jobs:
2222
fail-fast: false
2323
steps:
2424
- name: Harden Runner
25-
uses: step-security/harden-runner@1f99358870fe1c846a3ccba386cc2b2246836776 # v2.2.1
25+
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604 # v2.5.0
2626
with:
2727
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
2828

29-
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
29+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
3030
- name: Use Node.js ${{ matrix.node-version }}
31-
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
31+
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
3232
with:
3333
node-version: ${{ matrix.node-version }}
3434
- name: Install dependencies

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,37 +59,37 @@
5959
},
6060
"homepage": "https://github.com/NodeSecure/cli#readme",
6161
"devDependencies": {
62-
"@myunisoft/httpie": "^1.11.0",
63-
"@nodesecure/eslint-config": "^1.7.0",
62+
"@myunisoft/httpie": "^2.0.1",
63+
"@nodesecure/eslint-config": "^1.7.1",
6464
"@nodesecure/size-satisfies": "^1.1.0",
6565
"@nodesecure/vis-network": "^1.4.0",
66-
"@types/node": "^20.2.5",
67-
"c8": "^7.14.0",
66+
"@types/node": "^20.4.5",
67+
"c8": "^8.0.1",
6868
"cross-env": "^7.0.3",
69-
"esbuild": "^0.17.19",
70-
"eslint": "^8.41.0",
71-
"esmock": "^2.3.0",
69+
"esbuild": "^0.18.17",
70+
"eslint": "^8.46.0",
71+
"esmock": "^2.3.5",
7272
"http-server": "^14.1.1",
7373
"pkg-ok": "^3.0.0",
74-
"pretty-bytes": "^6.1.0",
74+
"pretty-bytes": "^6.1.1",
7575
"strip-ansi": "^7.1.0"
7676
},
7777
"dependencies": {
7878
"@nodesecure/documentation-ui": "^1.3.0",
7979
"@nodesecure/flags": "^2.4.0",
80-
"@nodesecure/i18n": "^3.2.0",
81-
"@nodesecure/npm-registry-sdk": "^1.5.2",
82-
"@nodesecure/ossf-scorecard-sdk": "^1.1.1",
80+
"@nodesecure/i18n": "^3.2.2",
81+
"@nodesecure/npm-registry-sdk": "^1.6.1",
82+
"@nodesecure/ossf-scorecard-sdk": "^2.0.0",
8383
"@nodesecure/rc": "^1.4.0",
8484
"@nodesecure/scanner": "^4.0.0",
8585
"@nodesecure/utils": "^1.1.0",
8686
"@nodesecure/vuln": "^1.7.0",
8787
"@openally/result": "^1.2.0",
8888
"@polka/send-type": "^0.5.2",
8989
"@topcli/cliui": "^1.1.0",
90-
"@topcli/spinner": "^2.0.0",
90+
"@topcli/spinner": "^2.1.2",
9191
"cacache": "^17.1.3",
92-
"dotenv": "^16.1.3",
92+
"dotenv": "^16.3.1",
9393
"filenamify": "^6.0.0",
9494
"ini": "^4.1.1",
9595
"kleur": "^4.1.5",
@@ -98,7 +98,7 @@
9898
"polka": "^0.5.2",
9999
"qoa": "^0.2.0",
100100
"sade": "^1.8.1",
101-
"semver": "^7.5.1",
101+
"semver": "^7.5.4",
102102
"server-destroy": "^1.0.1",
103103
"sirv": "^2.0.3",
104104
"zup": "0.0.1"

test/commands/scorecard.test.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ test("scorecard should display fastify scorecard", async() => {
3838
const scorecardCliOptions = {
3939
path: kProcessPath,
4040
args: [packageName],
41-
undiciMockAgentOptions: {
41+
undiciMockAgentOptions: [{
4242
baseUrl: API_URL,
4343
intercept: {
4444
path: `/projects/github.com/${packageName}`,
@@ -48,9 +48,23 @@ test("scorecard should display fastify scorecard", async() => {
4848
body: mockBody,
4949
status: 200
5050
}
51-
}
51+
},
52+
{
53+
baseUrl: "https://api.github.com",
54+
intercept: {
55+
path: "/repos/fastify/fastify",
56+
method: "GET"
57+
},
58+
response: {
59+
body: {
60+
full_name: "fastify/fastify"
61+
},
62+
status: 200
63+
}
64+
}]
5265
};
5366

67+
5468
const givenLines = await arrayFromAsync(runProcess(scorecardCliOptions));
5569
const expectedLines = getExpectedScorecardLines(packageName, mockBody);
5670

@@ -62,7 +76,7 @@ test("should not display scorecard for unknown repository", async() => {
6276
const scorecardCliOptions = {
6377
path: kProcessPath,
6478
args: [packageName],
65-
undiciMockAgentOptions: {
79+
undiciMockAgentOptions: [{
6680
baseUrl: API_URL,
6781
intercept: {
6882
path: `/projects/github.com/${packageName}`,
@@ -72,7 +86,7 @@ test("should not display scorecard for unknown repository", async() => {
7286
body: {},
7387
status: 500
7488
}
75-
}
89+
}]
7690
};
7791

7892
const expectedLines = [

test/helpers/cliCommandRunner.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,15 @@ export async function* runProcess(options) {
3131
export function prepareProcess(command, args = process.argv.slice(2)) {
3232
process.once("message", (undiciMockAgentOptions) => {
3333
if (undiciMockAgentOptions) {
34-
const { baseUrl, intercept, response } = undiciMockAgentOptions;
3534
const mockAgent = new MockAgent();
36-
const pool = mockAgent.get(baseUrl);
35+
for (const mock of undiciMockAgentOptions) {
36+
const { baseUrl, intercept, response } = mock;
37+
const pool = mockAgent.get(baseUrl);
38+
39+
pool.intercept(intercept).reply(response.status, () => response.body);
40+
}
3741

3842
mockAgent.disableNetConnect();
39-
pool.intercept(intercept).reply(response.status, () => response.body);
4043
setGlobalDispatcher(mockAgent);
4144
}
4245

test/httpServer.test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@ const kConfigKey = "cli-config";
3535
describe("httpServer", () => {
3636
let httpServer;
3737

38-
before((done) => {
38+
before(async() => {
3939
httpServer = buildServer(JSON_PATH, {
4040
port: HTTP_PORT,
4141
openLink: false
4242
});
43-
httpServer.server.on("listening", () => done(1));
43+
await once(httpServer.server, "listening");
44+
4445
enableDestroy(httpServer.server);
4546
}, { timeout: 5000 });
4647

0 commit comments

Comments
 (0)