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

38 lines
850 B
TypeScript
Raw Normal View History

2023-01-20 00:41:22 +00:00
import core from '@actions/core';
import 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-20 00:05:59 +00:00
import CondaParser from './condaParser';
2022-08-25 09:12:00 -07:00
async function run() {
2023-01-20 01:23:57 +00:00
let manifests = CondaParser.getManifestsFromEnvironmentFiles(
CondaParser.searchFiles(core.getInput('filePath'), core.getInput('filePattern')));
2022-08-25 11:50:14 -07:00
let snapshot = new Snapshot({
name: "conda-dependency-submission-action",
2022-08-25 11:50:14 -07:00
version: "0.0.1",
url: "https://github.com/jhutchings1/conda-dependency-submission-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();