mirror of
https://github.com/gradle/actions.git
synced 2026-03-23 20:45:47 +08:00
Refactor input parameters
Moved reading of all input parameters into a common source: `input-params.ts`. This centralized all input parameter reads, and allowed an improved implementation of reading boolean parameters. In particular, the implementation now provides a default value for a boolean input parameter that isn't declared for an action.
This commit is contained in:
@@ -5,6 +5,7 @@ import * as path from 'path'
|
||||
import * as os from 'os'
|
||||
import * as caches from './caches'
|
||||
import * as layout from './repository-layout'
|
||||
import * as params from './input-params'
|
||||
|
||||
import {logJobSummary, writeJobSummary} from './job-summary'
|
||||
import {loadBuildResults} from './build-results'
|
||||
@@ -14,7 +15,6 @@ import {DaemonController} from './daemon-controller'
|
||||
const GRADLE_SETUP_VAR = 'GRADLE_BUILD_ACTION_SETUP_COMPLETED'
|
||||
const GRADLE_USER_HOME = 'GRADLE_USER_HOME'
|
||||
const CACHE_LISTENER = 'CACHE_LISTENER'
|
||||
const JOB_SUMMARY_ENABLED_PARAMETER = 'generate-job-summary'
|
||||
|
||||
export async function setup(): Promise<void> {
|
||||
const gradleUserHome = await determineGradleUserHome()
|
||||
@@ -93,5 +93,5 @@ function shouldGenerateJobSummary(): boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
return core.getBooleanInput(JOB_SUMMARY_ENABLED_PARAMETER)
|
||||
return params.isJobSummaryEnabled()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user