diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index 13dba5f9..fd16f7b9 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -27,7 +27,7 @@ jobs: fetch-depth: 0 - name: Set up Node.js - uses: actions/setup-node@v5 + uses: actions/setup-node@v6 with: node-version: 24 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b3c68a65..7071f5c3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -30,7 +30,7 @@ jobs: fetch-depth: 0 - name: Install node 24 - uses: actions/setup-node@v5 + uses: actions/setup-node@v6 with: node-version: 24 cache: npm @@ -76,7 +76,7 @@ jobs: steps: - name: Get releasebranch.txt artifact from Release pipeline if: github.event_name == 'workflow_run' - uses: actions/download-artifact@v5 + uses: actions/download-artifact@v7 with: name: releasebranch.txt run-id: ${{ github.event.workflow_run.id }} @@ -96,7 +96,7 @@ jobs: fetch-depth: 0 - name: Install node 24 - uses: actions/setup-node@v5 + uses: actions/setup-node@v6 with: node-version: 24 cache: npm diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6905885c..4478fe4b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,7 +30,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - name: Install node 24 - uses: actions/setup-node@v5 + uses: actions/setup-node@v6 with: node-version: 24 cache: npm @@ -64,7 +64,7 @@ jobs: git push origin "$BRANCH" echo "$BRANCH" > releasebranch.txt - - uses: actions/upload-artifact@v5 + - uses: actions/upload-artifact@v6 with: name: releasebranch.txt path: releasebranch.txt diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0f6b77f0..186564c1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,7 +28,7 @@ jobs: uses: actions/checkout@v6 - name: Install node ${{ matrix.node }} - uses: actions/setup-node@v5 + uses: actions/setup-node@v6 with: node-version: ${{ matrix.node }} cache: npm @@ -66,14 +66,15 @@ jobs: go-version: '1.20.1' - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 + uses: gradle/actions/setup-gradle@v5 - name: Setup syft - uses: jaxxstorm/action-install-gh-release@v1.10.0 + uses: jaxxstorm/action-install-gh-release@v2.1.0 with: repo: anchore/syft platform: linux arch: amd64 + tag: v1.41.1 - name: Setup skopeo run: sudo apt update && sudo apt-get -y install skopeo @@ -96,7 +97,7 @@ jobs: - name: Upload coverage reports if: ${{ matrix.node == env.MAIN_NODE_VER }} - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: coverage path: ./coverage/coverage-final.json diff --git a/package-lock.json b/package-lock.json index 5cb8ded2..d76d157e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "fast-xml-parser": "^5.3.4", "help": "^3.0.2", "https-proxy-agent": "^7.0.6", - "node-fetch": "^2.7.0", + "node-fetch": "^3.3.2", "packageurl-js": "~1.0.2", "yargs": "^17.7.2" }, @@ -1944,6 +1944,15 @@ "node": ">= 8" } }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, "node_modules/data-view-buffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", @@ -2869,6 +2878,29 @@ "reusify": "^1.0.4" } }, + "node_modules/fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -2984,6 +3016,18 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "license": "MIT", + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, "node_modules/fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", @@ -4927,24 +4971,42 @@ "node": ">=10" } }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "deprecated": "Use your platform's native DOMException instead", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "engines": { + "node": ">=10.5.0" + } + }, "node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", "license": "MIT", "dependencies": { - "whatwg-url": "^5.0.0" + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" }, "engines": { - "node": "4.x || >=6.0.0" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" } }, "node_modules/node-gyp": { @@ -5754,7 +5816,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", "dev": true, "license": "ISC", "dependencies": { @@ -6688,12 +6750,6 @@ "node": ">=16" } }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "license": "MIT" - }, "node_modules/tsconfig-paths": { "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", @@ -6986,20 +7042,13 @@ "node": ">=10.12.0" } }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "license": "BSD-2-Clause" - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "node_modules/web-streams-polyfill": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", + "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", "license": "MIT", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" + "engines": { + "node": ">= 8" } }, "node_modules/which": { diff --git a/package.json b/package.json index eb833f7b..b528b5df 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "fast-xml-parser": "^5.3.4", "help": "^3.0.2", "https-proxy-agent": "^7.0.6", - "node-fetch": "^2.7.0", + "node-fetch": "^3.3.2", "packageurl-js": "~1.0.2", "yargs": "^17.7.2" }, diff --git a/test/providers/oci_images.test.js b/test/providers/oci_images.test.js index 2942936f..83d28913 100644 --- a/test/providers/oci_images.test.js +++ b/test/providers/oci_images.test.js @@ -14,12 +14,12 @@ suite('testing the OCI image data provider', () => { ].forEach(imageRef => { test(`verify OCI image sbom provided with scenario ${imageRef}`, () => { let expectedSbom = fs.readFileSync(`test/providers/tst_manifests/image/${imageRef}.json`).toString().trim() - expectedSbom = JSON.stringify(JSON.parse(expectedSbom), null, 4) + expectedSbom = JSON.parse(expectedSbom) let providedSbom = generateImageSBOM(parseImageRef(imageRef)) providedSbom['metadata'] = null providedSbom['serialNumber'] = null - expect(JSON.stringify(providedSbom, null, 4).trimEnd()).to.deep.equal(expectedSbom) + expect(providedSbom, null, 4).to.deep.equal(expectedSbom) }).timeout(40000) }); @@ -36,4 +36,4 @@ suite('testing the OCI image data provider', () => { }).timeout(10000) }) -}).beforeAll(() => clock = useFakeTimers(new Date('2023-08-07T00:00:00.000Z'))).afterAll(()=> clock.restore()); +}).beforeAll(() => clock = useFakeTimers(new Date('2023-08-07T00:00:00.000Z'))).afterAll(() => clock.restore());