-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.ts
39 lines (31 loc) · 926 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import * as core from '@actions/core';
import * as github from '@actions/github';
import {
PackageCache,
BuildTarget,
Package,
Snapshot,
Manifest,
submitSnapshot
} from '@github/dependency-submission-toolkit';
import ComponentDetection from './componentDetection';
async function run() {
let manifests = await ComponentDetection.scanAndGetManifests(core.getInput('filePath'));
let snapshot = new Snapshot({
name: "Component Detection",
version: "0.0.1",
url: "https://github.com/advanced-security/component-detection-dependency-submission-action",
},
github.context,
{
correlator:`${github.context.job}`,
id: github.context.runId.toString()
});
core.debug(`Manifests: ${manifests?.length}`);
manifests?.forEach(manifest => {
core.debug(`Manifest: ${JSON.stringify(manifest)}`);
snapshot.addManifest(manifest);
});
submitSnapshot(snapshot);
}
run();