mirror of
https://github.com/gradle/actions.git
synced 2025-11-26 17:09:10 +08:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user