Convert dependency-submission action to Typescript

Instead of being a thin wrapper over `setup-gradle`, the `dependency-submission`
action is now a fully-fledged action sharing implementation with `setup-gradle`.
This commit is contained in:
daz
2024-04-06 16:35:03 -06:00
parent 4214607904
commit ebf4d13461
8 changed files with 299 additions and 35 deletions

View File

@@ -58,6 +58,11 @@ function maybeExportVariable(variableName: string, value: unknown): void {
}
export async function complete(option: DependencyGraphOption): Promise<void> {
if (isRunningInActEnvironment()) {
core.info('Dependency graph upload and submit not supported in the ACT environment.')
return
}
try {
switch (option) {
case DependencyGraphOption.Disabled:
@@ -96,6 +101,11 @@ async function uploadDependencyGraphs(dependencyGraphFiles: string[]): Promise<v
}
async function downloadAndSubmitDependencyGraphs(): Promise<void> {
if (isRunningInActEnvironment()) {
core.info('Dependency graph download and submit not supported in the ACT environment.')
return
}
try {
await submitDependencyGraphs(await downloadDependencyGraphs())
} catch (e) {
@@ -242,3 +252,7 @@ function sanitize(value: string): string {
.replace(/\s+/g, '_')
.toLowerCase()
}
function isRunningInActEnvironment(): boolean {
return process.env.ACT !== undefined
}