Skip to content

[feature] Add new getBooleanInput function for the core #723

Description

@yi-Xu-0100

Thank you 🙇‍♀ for wanting to create an issue in this repository. Before you do, please ensure you are filing the issue in the right place. Issues should only be opened on if the issue relates to code in this repository.

If your issue is relevant to this repository, please include the information below:

Describe the enhancement

get the correct boolean input of workflows.

Code Snippet

exportfunctiongetBooleanInput(booleanInputName: string,options?: core.InputOptions){consttrueValue=['true','True','TRUE','yes','Yes','YES','y','Y','on','On','ON'];constfalseValue=['false','False','FALSE','no','No','NO','n','N','off','Off','OFF'];varstringInput=core.getInput(booleanInputName,options);if(trueValue.indexOf(stringInput)>-1)returntrue;if(falseValue.indexOf(stringInput)>-1)returnfalse;throwTypeError(`Wrong boolean input value of ${booleanInputName}`);}constbooleanInput=getBooleanInput('booleanInput')

Additional information

https://yaml.org/type/bool.html

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions