Files
component-detection-depende…/index.ts
T

37 lines
787 B
TypeScript
Raw Normal View History

2023-01-20 01:43:53 +00:00
import * as core from '@actions/core';
import * as github from '@actions/github';
2022-08-25 09:12:00 -07:00
2022-08-25 11:50:14 -07:00
import {
PackageCache,
BuildTarget,
Package,
Snapshot,
2022-10-04 13:16:36 -07:00
Manifest,
2022-08-25 11:50:14 -07:00
submitSnapshot
2023-01-20 00:41:22 +00:00
} from '@github/dependency-submission-toolkit';
2022-08-25 09:12:00 -07:00
2023-01-22 01:06:08 +00:00
import ComponentDetection from './componentDetection';
2023-01-20 00:05:59 +00:00
2022-08-25 09:12:00 -07:00
async function run() {
2023-01-22 01:06:08 +00:00
let manifests = await ComponentDetection.scanAndGetManifests(core.getInput('path'));
2022-08-25 11:50:14 -07:00
let snapshot = new Snapshot({
2023-01-22 01:06:08 +00:00
name: "Component Detection",
2022-08-25 11:50:14 -07:00
version: "0.0.1",
2023-01-22 01:06:08 +00:00
url: "https://github.com/jhutchings1/component-detection-action",
2022-10-04 09:44:26 -07:00
},
github.context,
{
correlator:`${github.context.job}`,
id: github.context.runId.toString()
2022-08-25 11:50:14 -07:00
});
2022-08-25 12:49:25 -07:00
manifests?.forEach(manifest => {
snapshot.addManifest(manifest);
2022-08-25 11:50:14 -07:00
});
submitSnapshot(snapshot);
}
2022-08-25 09:12:00 -07:00
run();