generated from actions/javascript-action
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a4364d
commit 44a9a79
Showing
17 changed files
with
316 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const core = require('@actions/core') | ||
|
||
/** | ||
* Validate binary input values. | ||
* @returns {bool|string} Returns a validated binary input. | ||
*/ | ||
module.exports = function validateBinary(standard = false) { | ||
const binary = core.getInput('binary', { required: true }) ?? standard | ||
core.debug( | ||
binary === true | ||
? 'Encoding into binary format' | ||
: 'Encoding into ASCII format' | ||
) | ||
return binary | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const core = require('@actions/core') | ||
|
||
/** | ||
* Validate callback input values. | ||
* @returns {bool|string} Returns a validated callback input. | ||
*/ | ||
module.exports = function validateCallback(standard = '') { | ||
const callback = | ||
core.getInput('callback-file', { required: true }) ?? standard | ||
core.debug( | ||
`Using callback file in runtime path: ${ | ||
callback === '' ? 'NONE' : callback | ||
}` | ||
) | ||
return callback | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const core = require('@actions/core') | ||
|
||
/** | ||
* Validate check input values. | ||
* @returns {bool|string} Returns a validated check input. | ||
*/ | ||
module.exports = function validateCheck(standard = 'auto') { | ||
let check = core.getInput('license-check', { required: true }) ?? standard | ||
|
||
if (check === 'auto') { | ||
check = 'auto' | ||
} else { | ||
check = 'script' | ||
} | ||
|
||
core.debug(`Using license check: ${check}`) | ||
return check | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const core = require('@actions/core') | ||
|
||
/** | ||
* Validate comments input values. | ||
* @returns {bool|string} Returns a validated comments input. | ||
*/ | ||
module.exports = function validateComments(standard = true) { | ||
const comments = !( | ||
core.getInput('no-doc-comments', { required: true }) ?? standard | ||
) | ||
core.debug( | ||
comments === true ? 'Allowing doc comments' : 'Now allow doc comments' | ||
) | ||
return comments | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const core = require('@actions/core') | ||
|
||
/** | ||
* Validate encrypt input values. | ||
* @returns {bool|string} Returns a validated encrypt input. | ||
*/ | ||
module.exports = function validateEncrypt(standard = '') { | ||
const encrypt = core.getInput('encrypt', { required: true }) ?? standard | ||
core.debug(`Encrypting files: ${encrypt === '' ? 'NONE' : encrypt}`) | ||
return encrypt | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const core = require('@actions/core') | ||
|
||
/** | ||
* Validate license input values. | ||
* @returns {bool|string} Returns a validated license input. | ||
*/ | ||
module.exports = function validateLicense(standard = '') { | ||
const license = core.getInput('with-license', { required: true }) ?? standard | ||
core.debug(`Using license file in runtime path: ${license}`) | ||
return license | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const core = require('@actions/core') | ||
|
||
/** | ||
* Validate loader input values. | ||
* @returns {bool|string} Returns a validated loader input. | ||
*/ | ||
module.exports = function validateLoader(standard = true) { | ||
const loader = !( | ||
core.getInput('without-loader-check', { required: true }) ?? standard | ||
) | ||
core.debug( | ||
loader === true | ||
? 'Checking for loader in environment' | ||
: 'Not checking for loader in environment' | ||
) | ||
return loader | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const core = require('@actions/core') | ||
|
||
/** | ||
* Validate optimize input values. | ||
* @returns {bool|string} Returns a validated optimize input. | ||
*/ | ||
module.exports = function validateOptimize(standard = 'max') { | ||
let optimize = core.getInput('optimize', { required: true }) ?? standard | ||
|
||
if (optimize === 'more') { | ||
optimize = 'more' | ||
} else { | ||
optimize = 'max' | ||
} | ||
|
||
core.debug(`Using optimization: ${optimize}`) | ||
return optimize | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const core = require('@actions/core') | ||
|
||
/** | ||
* Validate passphrase input values. | ||
* @returns {bool|string} Returns a validated passphrase input. | ||
*/ | ||
module.exports = function validatePassphrase(standard = '') { | ||
const passphrase = core.getInput('passphrase', { required: true }) ?? standard | ||
core.debug(`Using passphrase: ${passphrase === '' ? 'NONE' : passphrase}`) | ||
return passphrase | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const core = require('@actions/core') | ||
|
||
/** | ||
* Validate preamble input values. | ||
* @returns {bool|string} Returns a validated preamble input. | ||
*/ | ||
module.exports = function validatePreamble(standard = '') { | ||
const preamble = | ||
core.getInput('preamble-file', { required: true }) ?? standard | ||
core.debug(`Adding preamble file: ${preamble === '' ? 'NONE' : preamble}`) | ||
return preamble | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const core = require('@actions/core') | ||
|
||
/** | ||
* Validate reflection input values. | ||
* @returns {bool|string} Returns a validated reflection input. | ||
*/ | ||
module.exports = function validateReflection(standard = false) { | ||
const reflectionAll = | ||
core.getInput('allow-reflection-all', { required: true }) ?? standard | ||
|
||
if (reflectionAll === true) { | ||
core.debug('Allowing reflection for all') | ||
return true | ||
} | ||
|
||
const reflection = | ||
core.getInput('allow-reflection', { required: true }) ?? | ||
(standard === false ? '' : standard) | ||
core.debug(`Using reflection for: ${reflection === '' ? 'NONE' : reflection}`) | ||
return reflection | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.