Skip to content

Commit

Permalink
removing required flag for not required parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
MuriloChianfa committed Dec 8, 2023
1 parent 00d3416 commit 3aac35d
Show file tree
Hide file tree
Showing 19 changed files with 53 additions and 67 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ jobs:
uses: ./
with:
template: 'php'
source: ''
output: 'encrypted'

- name: Print Output
id: output
Expand Down
34 changes: 17 additions & 17 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ inputs:
# Basic inputs
trial:
description: 'Encode file with trial version of ioncube'
required: true
required: false
default: false
type: boolean
template:
description: 'The template to choose the best parameters for type of projects'
required: true
required: false
default: laravel
type: choice
options:
Expand All @@ -21,7 +21,7 @@ inputs:
# Encoder inputs
encoder-version:
description: 'Ioncube encoder version'
required: true
required: false
default: 'current'
type: choice
options:
Expand All @@ -30,7 +30,7 @@ inputs:
- obsolete
php-target-version:
description: 'PHP encoded files target version'
required: true
required: false
default: '8.2'
type: choice
options:
Expand All @@ -39,7 +39,7 @@ inputs:
- '8.0'
arch:
description: 'Architecture of target environment runner'
required: true
required: false
default: 64
type: choice
options:
Expand All @@ -61,29 +61,29 @@ inputs:
# Reflection API
allow-reflection:
description: 'Name or glob to funcions or classes for allow the reflection API'
required: true
required: false
default: ''
type: string
allow-reflection-all:
description: 'Allow the reflection API at all the PHP code'
required: true
required: false
default: false
type: boolean

# Files customization
encrypt:
description: 'Name or glob to files to encrypt'
required: true
required: false
default: ''
type: string
binary:
description: 'Encode files in binary format'
required: true
required: false
default: false
type: boolean
optimize:
description: 'Level of encoding performance'
required: true
required: false
default: 'more'
type: choice
options:
Expand All @@ -93,42 +93,42 @@ inputs:
# Output customizations
no-doc-comments:
description: 'Not allow doc comments on encoded files'
required: true
required: false
default: true
type: boolean
without-loader-check:
description: 'Disable the ioncube loader installation verification'
required: true
required: false
default: true
type: boolean
preamble-file:
description: 'File for insert into header of all encoded files'
required: true
required: false
default: ''
type: string

# License options
passphrase:
description: 'Text to identify and encode the project unically'
required: true
required: false
default: ''
type: string
license-check:
description: 'Mode of license validation for encoded files'
required: true
required: false
default: 'auto'
type: choice
options:
- 'auto'
- 'script'
with-license:
description: 'The license file path at runtime environment'
required: true
required: false
default: ''
type: string
callback-file:
description: 'File to validate manually when license is invalid'
required: true
required: false
default: ''
type: string

Expand Down
42 changes: 17 additions & 25 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/inputs/architecture.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const core = require('@actions/core')
* @returns {string} Returns a validated arch input.
*/
module.exports = function validateArchitecture(standard = '64') {
let arch = core.getInput('arch', { required: true }) ?? standard
let arch = core.getInput('arch', { required: false }) ?? standard

if (arch === '86') {
arch = 'x86'
Expand Down
2 changes: 1 addition & 1 deletion src/inputs/binary.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const core = require('@actions/core')
* @returns {bool|string} Returns a validated binary input.
*/
module.exports = function validateBinary(standard = false) {
const binary = core.getInput('binary', { required: true }) ?? standard
const binary = core.getInput('binary') ?? standard
core.debug(
binary === true
? 'Encoding into binary format'
Expand Down
3 changes: 1 addition & 2 deletions src/inputs/callback.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ const core = require('@actions/core')
* @returns {bool|string} Returns a validated callback input.
*/
module.exports = function validateCallback(standard = '') {
const callback =
core.getInput('callback-file', { required: true }) ?? standard
const callback = core.getInput('callback-file') ?? standard
core.debug(
`Using callback file in runtime path: ${
callback === '' ? 'NONE' : callback
Expand Down
2 changes: 1 addition & 1 deletion src/inputs/check.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const core = require('@actions/core')
* @returns {bool|string} Returns a validated check input.
*/
module.exports = function validateCheck(standard = 'auto') {
let check = core.getInput('license-check', { required: true }) ?? standard
let check = core.getInput('license-check') ?? standard

if (check === 'auto') {
check = 'auto'
Expand Down
4 changes: 1 addition & 3 deletions src/inputs/comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ const core = require('@actions/core')
* @returns {bool|string} Returns a validated comments input.
*/
module.exports = function validateComments(standard = true) {
const comments = !(
core.getInput('no-doc-comments', { required: true }) ?? standard
)
const comments = !(core.getInput('no-doc-comments') ?? standard)
core.debug(
comments === true ? 'Allowing doc comments' : 'Now allow doc comments'
)
Expand Down
2 changes: 1 addition & 1 deletion src/inputs/encoder-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const core = require('@actions/core')
*/
module.exports = function validateEncoderVersion(standard = 'current') {
let encoderVersion =
core.getInput('encoder-version', { required: true }) ?? standard
core.getInput('encoder-version', { required: false }) ?? standard

core.debug(`Using encoder version: ${encoderVersion}`)

Expand Down
2 changes: 1 addition & 1 deletion src/inputs/encrypt.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const core = require('@actions/core')
* @returns {bool|string} Returns a validated encrypt input.
*/
module.exports = function validateEncrypt(standard = '') {
const encrypt = core.getInput('encrypt', { required: true }) ?? standard
const encrypt = core.getInput('encrypt') ?? standard
core.debug(`Encrypting files: ${encrypt === '' ? 'NONE' : encrypt}`)
return encrypt
}
2 changes: 1 addition & 1 deletion src/inputs/license.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const core = require('@actions/core')
* @returns {bool|string} Returns a validated license input.
*/
module.exports = function validateLicense(standard = '') {
const license = core.getInput('with-license', { required: true }) ?? standard
const license = core.getInput('with-license') ?? standard
core.debug(
`Using license file in runtime path: ${license === '' ? 'NONE' : license}`
)
Expand Down
4 changes: 1 addition & 3 deletions src/inputs/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ const core = require('@actions/core')
* @returns {bool|string} Returns a validated loader input.
*/
module.exports = function validateLoader(standard = true) {
const loader = !(
core.getInput('without-loader-check', { required: true }) ?? standard
)
const loader = !(core.getInput('without-loader-check') ?? standard)
core.debug(
loader === true
? 'Checking for loader in environment'
Expand Down
2 changes: 1 addition & 1 deletion src/inputs/optimize.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const core = require('@actions/core')
* @returns {bool|string} Returns a validated optimize input.
*/
module.exports = function validateOptimize(standard = 'more') {
let optimize = core.getInput('optimize', { required: true }) ?? standard
let optimize = core.getInput('optimize') ?? standard

if (optimize === 'more') {
optimize = 'more'
Expand Down
Loading

0 comments on commit 3aac35d

Please sign in to comment.