From d40c3a1aa354fa8ffcf3be44a5668b1f218c8b6b Mon Sep 17 00:00:00 2001 From: FredGuiou <99122562+FredGuiou@users.noreply.github.com> Date: Wed, 15 May 2024 15:45:28 +0200 Subject: [PATCH] chore: update dependencies (#201) --- .github/workflows/codeql.yml | 10 +++++----- .github/workflows/node.js.yml | 4 ++-- .github/workflows/scorecard.yml | 10 +++++----- index.js | 13 +++++++------ package.json | 10 +++++----- test/test.spec.js | 6 +++--- 6 files changed, 27 insertions(+), 26 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 6f3f483..9facc9b 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -41,16 +41,16 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 + uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs - name: Checkout repository - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@3ab4101902695724f9365a384f86c1074d94e18c # v3.24.7 + uses: github/codeql-action/init@b7cec7526559c32f1616476ff32d17ba4c59b2d6 # v3.25.5 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -63,7 +63,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@3ab4101902695724f9365a384f86c1074d94e18c # v3.24.7 + uses: github/codeql-action/autobuild@b7cec7526559c32f1616476ff32d17ba4c59b2d6 # v3.25.5 # ℹī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -76,6 +76,6 @@ jobs: # ./location_of_script_within_repo/buildscript.sh - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@3ab4101902695724f9365a384f86c1074d94e18c # v3.24.7 + uses: github/codeql-action/analyze@b7cec7526559c32f1616476ff32d17ba4c59b2d6 # v3.25.5 with: category: "/language:${{matrix.language}}" \ No newline at end of file diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 1181112..1237f6d 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -17,11 +17,11 @@ jobs: fail-fast: false steps: - name: Harden Runner - uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 + uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 3aa1fb3..b16554d 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -32,17 +32,17 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 + uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs - name: "Checkout code" - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v3.3.0 # v3.1.0 + uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 with: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1 + uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3 with: results_file: results.sarif results_format: sarif @@ -64,7 +64,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 with: name: SARIF file path: results.sarif @@ -72,6 +72,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@3ab4101902695724f9365a384f86c1074d94e18c # v3.24.7 + uses: github/codeql-action/upload-sarif@b7cec7526559c32f1616476ff32d17ba4c59b2d6 # v3.25.5 with: sarif_file: results.sarif diff --git a/index.js b/index.js index 132ba89..611c05a 100644 --- a/index.js +++ b/index.js @@ -1,8 +1,8 @@ // Import Node.js Dependencies -import path from "path"; -import { createWriteStream, createReadStream, promises as fs } from "fs"; -import { createGunzip } from "zlib"; -import { pipeline } from "stream/promises"; +import path from "node:path"; +import { createWriteStream, createReadStream, promises as fs } from "node:fs"; +import { createGunzip } from "node:zlib"; +import { pipeline } from "node:stream/promises"; // Import Third-party Dependencies import tar from "tar-fs"; @@ -37,10 +37,11 @@ export async function download(repository, options = Object.create(null)) { // Download the archive with the repositoryId const repositoryURL = new URL(`${gitlabManifest.id}/repository/archive.tar.gz?ref=${wantedBranch}`, GITLAB_URL ?? kGitlabURL); - await httpie.stream("GET", repositoryURL, { + const writableCallback = httpie.stream("GET", repositoryURL, { headers: { ...headers, "Accept-Encoding": "gzip, deflate" }, maxRedirections: 1 - })(createWriteStream(location)); + }); + await writableCallback(() => createWriteStream(location)); return { location, diff --git a/package.json b/package.json index acf6bc8..42650c2 100644 --- a/package.json +++ b/package.json @@ -29,15 +29,15 @@ }, "homepage": "https://github.com/NodeSecure/gitlab#readme", "dependencies": { - "@myunisoft/httpie": "^1.10.0", - "tar-fs": "^2.1.1" + "@myunisoft/httpie": "^4.0.1", + "tar-fs": "^3.0.6" }, "devDependencies": { - "@nodesecure/eslint-config": "^1.5.0", + "@nodesecure/eslint-config": "^1.9.0", "@slimio/is": "^2.0.0", "c8": "^9.1.0", - "dotenv": "^16.0.2", - "eslint": "^8.23.0", + "dotenv": "^16.4.5", + "eslint": "^9.2.0", "pkg-ok": "^3.0.0" }, "engines": { diff --git a/test/test.spec.js b/test/test.spec.js index d2d60a0..6cb9341 100644 --- a/test/test.spec.js +++ b/test/test.spec.js @@ -1,7 +1,7 @@ // Import Node.js Dependencies -import { fileURLToPath } from "url"; -import path from "path"; -import fs from "fs/promises"; +import { fileURLToPath } from "node:url"; +import path from "node:path"; +import fs from "node:fs/promises"; import { test } from "node:test"; import assert from "node:assert";