Use dependency-submission-toolkit published on npmjs.com
This commit is contained in:
18
dist/index.js
generated
vendored
18
dist/index.js
generated
vendored
@@ -3491,7 +3491,7 @@ class Dependency {
|
||||
this.scope = scope;
|
||||
}
|
||||
/**
|
||||
* toJSON is a custom JSON-serializer. It will be called when JSON.stringfy()
|
||||
* toJSON is a custom JSON-serializer. It will be called when JSON.stringify()
|
||||
* is called with this class or any object containing this class.
|
||||
*
|
||||
* @returns {object} with keys package_url, relationship, scope, and
|
||||
@@ -3519,14 +3519,14 @@ class Manifest {
|
||||
}
|
||||
/**
|
||||
* addIndirectDependency adds a package as an indirect dependency to the
|
||||
* manifest. Direct dependencies take precendence over indirect dependencies
|
||||
* manifest. Direct dependencies take precedence over indirect dependencies
|
||||
* if a package is added as both.
|
||||
*
|
||||
* @param {Package} pkg
|
||||
* @param {DependencyScope} scope
|
||||
*/
|
||||
addDirectDependency(pkg, scope) {
|
||||
// will overwrite any previous indirect assigments
|
||||
// will overwrite any previous indirect assignments
|
||||
this.resolved[pkg.packageID()] = new Dependency(pkg, 'direct', scope);
|
||||
}
|
||||
/**
|
||||
@@ -3540,7 +3540,7 @@ class Manifest {
|
||||
addIndirectDependency(pkg, scope) {
|
||||
var _a;
|
||||
var _b, _c;
|
||||
// nullish assigment to keep any previous assignments, including direct assigments
|
||||
// nullish assignment to keep any previous assignments, including direct assignments
|
||||
(_a = (_b = this.resolved)[_c = pkg.packageID()]) !== null && _a !== void 0 ? _a : (_b[_c] = new Dependency(pkg, 'indirect', scope));
|
||||
}
|
||||
hasDependency(pkg) {
|
||||
@@ -3632,7 +3632,7 @@ class PackageCache {
|
||||
/**
|
||||
* 'cache.package()' will be the most commonly used method of PackageCache.
|
||||
* package(identifier) will create and add a new Package to the PackageCache if no
|
||||
* Packaging with a matching identifer exists in PackageCache, or return an existing
|
||||
* Packaging with a matching identifier exists in PackageCache, or return an existing
|
||||
* Package if a match is found. The mutation in this case is expected; do not
|
||||
* use package(identifier) to determine if a package is already added.
|
||||
* Instead, use hasPackage or lookupPackage.
|
||||
@@ -3884,11 +3884,11 @@ function jobFromContext(context) {
|
||||
}
|
||||
exports.jobFromContext = jobFromContext;
|
||||
/**
|
||||
* Snapshot is the top-level container for Dependency Submisison
|
||||
* Snapshot is the top-level container for Dependency Submission
|
||||
*/
|
||||
class Snapshot {
|
||||
/**
|
||||
* All construor parameters of a Snapshot are optional, but can be specified for specific overrides
|
||||
* All constructor parameters of a Snapshot are optional, but can be specified for specific overrides
|
||||
*
|
||||
* @param {Detector} detector
|
||||
* @param {Context} context
|
||||
@@ -3935,7 +3935,7 @@ function submitSnapshot(snapshot, context = github.context) {
|
||||
core.notice('Submitting snapshot...');
|
||||
core.notice(snapshot.prettyJSON());
|
||||
const repo = context.repo;
|
||||
const githubToken = core.getInput('token') || core.getIDToken;
|
||||
const githubToken = core.getInput('token') || (yield core.getIDToken());
|
||||
const octokit = new rest_1.Octokit({
|
||||
auth: githubToken
|
||||
});
|
||||
@@ -3948,7 +3948,7 @@ function submitSnapshot(snapshot, context = github.context) {
|
||||
repo: repo.repo,
|
||||
data: JSON.stringify(snapshot)
|
||||
});
|
||||
core.notice('Snapshot sucessfully created at ' + response.data.created_at.toString());
|
||||
core.notice('Snapshot successfully created at ' + response.data.created_at.toString());
|
||||
}
|
||||
catch (error) {
|
||||
if (error instanceof request_error_1.RequestError) {
|
||||
|
||||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
15
package-lock.json
generated
15
package-lock.json
generated
@@ -12,7 +12,7 @@
|
||||
"@actions/core": "^1.6.0",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/github": "^5.0.3",
|
||||
"@github/dependency-submission-toolkit": "^1.2.0",
|
||||
"@github/dependency-submission-toolkit": "^1.2.2",
|
||||
"packageurl-js": "^0.0.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -673,10 +673,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@github/dependency-submission-toolkit": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://npm.pkg.github.com/download/@github/dependency-submission-toolkit/1.2.0/cd4d278f4bad1f7056d73bc205b8c7484980f7ffcb9c52c1df36dbc366a6221c",
|
||||
"integrity": "sha512-b51hiCwNDO9Eim2MPvyeTDD1XxN7gpptRLGtUsnTpf8kcCILnVSbmbwjLfj4HNDbzg05yqfqW5jnI6ET2aFIqA==",
|
||||
"license": "MIT",
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/@github/dependency-submission-toolkit/-/dependency-submission-toolkit-1.2.2.tgz",
|
||||
"integrity": "sha512-ibRsqT0fTf8ydR8mrvvoSD5rZsxPkAKNNIVO8L5DE6lq2+qf090sSXv/yiRRJ4n4UuetneSA6os7+Y9H7gOeTw==",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.6.0",
|
||||
"@actions/exec": "^1.1.1",
|
||||
@@ -6383,9 +6382,9 @@
|
||||
}
|
||||
},
|
||||
"@github/dependency-submission-toolkit": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://npm.pkg.github.com/download/@github/dependency-submission-toolkit/1.2.0/cd4d278f4bad1f7056d73bc205b8c7484980f7ffcb9c52c1df36dbc366a6221c",
|
||||
"integrity": "sha512-b51hiCwNDO9Eim2MPvyeTDD1XxN7gpptRLGtUsnTpf8kcCILnVSbmbwjLfj4HNDbzg05yqfqW5jnI6ET2aFIqA==",
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/@github/dependency-submission-toolkit/-/dependency-submission-toolkit-1.2.2.tgz",
|
||||
"integrity": "sha512-ibRsqT0fTf8ydR8mrvvoSD5rZsxPkAKNNIVO8L5DE6lq2+qf090sSXv/yiRRJ4n4UuetneSA6os7+Y9H7gOeTw==",
|
||||
"requires": {
|
||||
"@actions/core": "^1.6.0",
|
||||
"@actions/exec": "^1.1.1",
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
"@actions/core": "^1.6.0",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/github": "^5.0.3",
|
||||
"@github/dependency-submission-toolkit": "^1.2.0",
|
||||
"@github/dependency-submission-toolkit": "^1.2.2",
|
||||
"packageurl-js": "^0.0.6"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user