Make dependency-submission and setup-gradle play nicely

Now, a `dependency-submission` step will trigger a dependency-graph
generation, even if it follows a `setup-gradle` step in the workflow.

Similarly, a `setup-gradle` step with `dependency-graph` configured
will function as expected even if it follows a `setup-gradle` step.
This commit is contained in:
daz
2024-04-06 19:03:51 -06:00
parent ebf4d13461
commit ed4d086d37
7 changed files with 33 additions and 26 deletions

View File

@@ -23,6 +23,7 @@ const DEPENDENCY_GRAPH_PREFIX = 'dependency-graph_'
export async function setup(option: DependencyGraphOption): Promise<void> {
if (option === DependencyGraphOption.Disabled) {
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_ENABLED', 'false')
return
}
// Download and submit early, for compatability with dependency review.
@@ -32,7 +33,7 @@ export async function setup(option: DependencyGraphOption): Promise<void> {
}
core.info('Enabling dependency graph generation')
maybeExportVariable('GITHUB_DEPENDENCY_GRAPH_ENABLED', 'true')
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_ENABLED', 'true')
maybeExportVariable('GITHUB_DEPENDENCY_GRAPH_CONTINUE_ON_FAILURE', getDependencyGraphContinueOnFailure())
maybeExportVariable('GITHUB_DEPENDENCY_GRAPH_JOB_CORRELATOR', getJobCorrelator())
maybeExportVariable('GITHUB_DEPENDENCY_GRAPH_JOB_ID', github.context.runId)