Correctly checks if values are true

This commit is contained in:
JamesIves 2020-03-28 13:04:59 -04:00
parent 6f2772d51f
commit 008bf69458

View File

@ -13,7 +13,7 @@ export interface ActionInterface {
/** The branch that the action should deploy to. */
branch: string
/** If your project generates hashed files on build you can use this option to automatically delete them from the deployment branch with each deploy. This option can be toggled on by setting it to true. */
clean?: string | boolean
clean?: boolean
/** If you need to use CLEAN but you'd like to preserve certain files or folders you can use this option. */
cleanExclude?: string | string[]
/** If you need to customize the commit message for an integration you can do so. */
@ -27,7 +27,7 @@ export interface ActionInterface {
/** GitHub deployment token. */
gitHubToken?: string | null
/** Determines if the action is running in test mode or not. */
isTest?: string | undefined | null
isTest?: boolean
/** The git config name. */
name?: string
/** The repository path, for example JamesIves/github-pages-deploy-action. */
@ -37,7 +37,7 @@ export interface ActionInterface {
/** The root directory where your project lives. */
root?: string
/** Set to true if you're using an ssh client in your build step. */
ssh?: string | boolean | null
ssh?: boolean
/** If you'd like to push the contents of the deployment folder into a specific directory on the deployment branch you can specify it here. */
targetFolder?: string
/** The token type, ie ssh/github token/access token, this gets automatically generated. */
@ -53,11 +53,17 @@ export const action: ActionInterface = {
folder: getInput('FOLDER'),
branch: getInput('BRANCH'),
commitMessage: getInput('COMMIT_MESSAGE'),
clean: getInput('CLEAN'),
clean: !isNullOrUndefined(getInput('CLEAN'))
? getInput('CLEAN').toLowerCase() === 'true'
: false,
cleanExclude: getInput('CLEAN_EXCLUDE'),
defaultBranch: process.env.GITHUB_SHA ? process.env.GITHUB_SHA : 'master',
isTest: process.env.UNIT_TEST,
ssh: getInput('SSH'),
isTest: process.env.UNIT_TEST
? process.env.UNIT_TEST.toLowerCase() === 'true'
: false,
ssh: !isNullOrUndefined(getInput('SSH'))
? getInput('SSH').toLowerCase() === 'true'
: false,
email: !isNullOrUndefined(getInput('GIT_CONFIG_EMAIL'))
? getInput('GIT_CONFIG_EMAIL')
: pusher && pusher.email