Use core functionality to access action inputs

- Specify default values in action.yaml definition where appropriate
- Replace custom methods with core functions:
  -  getInputBoolean() with core.getBooleanInput()
  - inputOrNull() with core.getInput()
  - inputArrayOrNull() with core.getMultilineInput()
- Remove github-utils.js
This commit is contained in:
Daz DeBoer 2021-07-20 11:44:56 -06:00
parent b9684c0cf5
commit 02d4f46354
No known key found for this signature in database
GPG key ID: DD6B9F0B06683D5D
7 changed files with 26 additions and 54 deletions

View file

@ -4,7 +4,6 @@ import fs from 'fs'
import * as core from '@actions/core'
import * as cache from '@actions/cache'
import * as github from './github-utils'
import * as crypto from './crypto-utils'
import {inputCacheKeyGlobs, tryDeleteFiles} from './cache-dependencies'
@ -22,7 +21,7 @@ export async function restoreCachedConfiguration(
if (fs.existsSync(cachePath)) return
core.saveState(CONFIGURATION_CACHE_PATH, cachePath)
const inputCacheExact = github.inputBoolean('configuration-cache-exact')
const inputCacheExact = core.getBooleanInput('configuration-cache-exact')
const cacheKeyGlobs = inputCacheKeyGlobs('configuration-cache-key')
const hash = await crypto.hashFiles(rootDir, cacheKeyGlobs)
@ -93,5 +92,5 @@ export async function cacheConfiguration(): Promise<void> {
}
function isConfigurationCacheDisabled(): boolean {
return !github.inputBoolean('configuration-cache-enabled', false)
return !core.getBooleanInput('configuration-cache-enabled')
}