Skip to content

Commit 9c54209

Browse files
committed
Merge branch 'dependency-review' of https://github.com/advanced-security/github-sbom-toolkit into dependency-review
2 parents 8554a0a + fc20a4c commit 9c54209

File tree

5 files changed

+5
-9
lines changed

5 files changed

+5
-9
lines changed

src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ async function main() {
5858
if (!args.enterprise && !args.org && !args.repo) throw new Error("Provide --enterprise, --org or --repo with --sync-sboms");
5959
if (args.enterprise && args.org) throw new Error("Specify only one of --enterprise or --org");
6060
if (args.repo && (args.enterprise || args.org)) throw new Error("Specify only one of --enterprise, --org, or --repo");
61-
if (!args.sbomCache) throw new Error("--sync-sboms requires --sbom-cache to write updated SBOMs to disk");
61+
if (!args.sbomCache) throw new Error("--sync-sboms requires --sbom-cache to write updated SBOMs to disk");
6262
} else {
6363
const malwareOnly = !!args["sync-malware"] && !args.sbomCache && !args.purl && !args["purl-file"] && !args["match-malware"] && !args.uploadSarif && !args.interactive;
6464
if (!malwareOnly && !args.sbomCache) throw new Error("Offline mode requires --sbom-cache unless running --sync-malware by itself");

src/componentDetection.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export default class ComponentDetection {
105105
public static async getManifestsFromResults(file: string, path: string): Promise<Manifest[] | undefined> {
106106
console.debug(`Reading results from ${file}`);
107107
const results = await fs.readFileSync(file, 'utf8');
108-
var json: any = JSON.parse(results);
108+
const json: any = JSON.parse(results);
109109

110110
let dependencyGraphs: DependencyGraphs = this.normalizeDependencyGraphPaths(json.dependencyGraphs, path);
111111

@@ -300,7 +300,7 @@ export default class ComponentDetection {
300300
try {
301301
const latestRelease = await octokit.request("GET /repos/{owner}/{repo}/releases/latest", { owner, repo });
302302

303-
var downloadURL: string = "";
303+
let downloadURL: string = "";
304304
// TODO: do we need to handle different architectures here?
305305
// can we allow x64 on MacOS? We could allow an input parameter to override?
306306
const assetName = process.platform === "win32" ? "component-detection-win-x64.exe" : process.platform === "linux" ? "component-detection-linux-x64" : "component-detection-osx-arm64";

src/componentSubmission.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export async function submitSnapshotIfPossible(opts: SubmitOpts): Promise<boolea
8383
return false;
8484
}
8585

86-
return false;
86+
return true;
8787
}
8888

8989
function buildSparsePatterns(langs: string[]): string[] {

src/test-branch-search.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ async function main() {
1919
{ name: 'chalk', version: '5.6.1', purl: 'pkg:npm/[email protected]' },
2020
{ name: 'react', version: '18.2.0', purl: 'pkg:npm/[email protected]' }
2121
];
22-
const featurePackages = [
23-
{ name: 'react', version: '18.3.0-beta', purl: 'pkg:npm/[email protected]' },
24-
{ name: 'lodash', version: '4.17.21', purl: 'pkg:npm/[email protected]' }
25-
];
2622
const diffChanges = [
2723
{ changeType: 'added', name: 'lodash', ecosystem: 'npm', purl: 'pkg:npm/[email protected]', version: '4.17.21' },
2824
{ changeType: 'updated', name: 'react', ecosystem: 'npm', purl: 'pkg:npm/[email protected]', version: '18.2.0', newVersion: '18.3.0-beta' }

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export interface DependencyReviewPackageChange {
122122
}
123123

124124
export interface BranchDependencyDiff {
125-
latestCommitDate: any;
125+
latestCommitDate: string;
126126
base: string; // base branch
127127
head: string; // head branch
128128
retrievedAt: string;

0 commit comments

Comments
 (0)