gradle-build-action/src/dependency-graph-generate.ts
daz be413309fa
First cut at actions for dependency-graph
- Dependency graph init-script references published version of plugin jar.
- `dependency-graph-generate` action will:
     - Provision Gradle if required
     - Execute Gradle with dependency-graph plugin to generate graph JSON
     - Upload dependency-graph JSON file as workflow artifact
- `dependency-graph-submit` action will:
    - Download dependency-graph JSON artifact
    - Submit the graph via the GitHub dependency submission API
2023-06-28 11:24:57 -06:00

24 lines
690 B
TypeScript

import * as core from '@actions/core'
import * as provisioner from './provision'
import * as dependencyGraph from './dependency-graph'
/**
* The main entry point for the action, called by Github Actions for the step.
*/
export async function run(): Promise<void> {
try {
// Download and install Gradle if required
const executable = await provisioner.provisionGradle()
// Generate and upload dependency graph artifact
await dependencyGraph.generateDependencyGraph(executable)
} catch (error) {
core.setFailed(String(error))
if (error instanceof Error && error.stack) {
core.info(error.stack)
}
}
}
run()