Add character decoding

This commit is contained in:
Justin Hutchings
2022-10-04 14:26:24 -07:00
parent 22ec523d65
commit ab368561f7
6 changed files with 413 additions and 7 deletions
Generated Vendored
+369 -3
View File
File diff suppressed because one or more lines are too long
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long
Generated Vendored
+24
View File
@@ -622,6 +622,30 @@ under a Creative Commons Attribution-ShareAlike 4.0 International License
https://creativecommons.org/licenses/by-sa/4.0/
he
MIT
Copyright Mathias Bynens <https://mathiasbynens.be/>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
inflight
ISC
The ISC License
+2 -1
View File
@@ -2,6 +2,7 @@ const core = require('@actions/core');
const github = require('@actions/github');
const fs = require('fs');
const glob = require('glob');
const he = require('he');
import {
PackageCache,
@@ -43,7 +44,7 @@ function getManifestFromSpdxFile(document, fileName) {
document.packages?.forEach(pkg => {
let packageName = pkg.name;
let packageVersion = pkg.packageVersion;
let purl = pkg.externalRefs?.find(ref => ref.referenceCategory === "PACKAGE-MANAGER" && ref.referenceType === "purl")?.referenceLocator;
let purl = he.decode(pkg.externalRefs?.find(ref => ref.referenceCategory === "PACKAGE-MANAGER" && ref.referenceType === "purl")?.referenceLocator);
if (purl == null || purl == undefined) {
purl = `pkg:generic/${packageName}@${packageVersion}`;
}
+15 -1
View File
@@ -12,7 +12,8 @@
"@actions/core": "^1.2.5",
"@actions/github": "^5.1.1",
"@github/dependency-submission-toolkit": "^1.2.2",
"fs": "^0.0.1-security"
"fs": "^0.0.1-security",
"he": "^1.2.0"
},
"devDependencies": {
"@vercel/ncc": "^0.31.1",
@@ -2626,6 +2627,14 @@
"node": ">=4"
}
},
"node_modules/he": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
"integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
"bin": {
"he": "bin/he"
}
},
"node_modules/html-encoding-sniffer": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz",
@@ -7091,6 +7100,11 @@
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
"dev": true
},
"he": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
"integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw=="
},
"html-encoding-sniffer": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz",
+2 -1
View File
@@ -28,7 +28,8 @@
"@actions/core": "^1.2.5",
"@actions/github": "^5.1.1",
"@github/dependency-submission-toolkit": "^1.2.2",
"fs": "^0.0.1-security"
"fs": "^0.0.1-security",
"he": "^1.2.0"
},
"devDependencies": {
"@vercel/ncc": "^0.31.1",