2022-08-25 09:12:00 -07:00
|
|
|
const core = require('@actions/core');
|
2022-10-04 09:44:26 -07:00
|
|
|
const github = require('@actions/github');
|
2022-08-25 11:50:14 -07:00
|
|
|
const fs = require('fs');
|
|
|
|
|
const glob = require('glob');
|
2023-01-19 20:10:29 +00:00
|
|
|
const yaml = require('yaml');
|
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
|
|
|
|
|
} 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 00:05:59 +00:00
|
|
|
let manifests = CondaParser.getManifestsFromEnvironmentFiles(CondaParser.searchFiles());
|
2022-08-25 11:50:14 -07:00
|
|
|
|
|
|
|
|
let snapshot = new Snapshot({
|
2023-01-19 20:10:29 +00:00
|
|
|
name: "conda-dependency-submission-action",
|
2022-08-25 11:50:14 -07:00
|
|
|
version: "0.0.1",
|
2023-01-19 20:10:29 +00:00
|
|
|
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();
|