Factor out `parseYAMLBoolean` from `core.getBooleanInput`
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.9k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
The (relatively new) function getBooleanInput in core bundles the parsing of a YAML boolean with getInput. However, that parsing functionality would be useful on its own.
I suggest to factor out function parseYAMLBoolean(text: string): boolean from getBooleanInput such that the latter is essentially just a composition of parseYAMLBoolean and getInput:
function getBooleanInput(name: string, options?: InputOptions): boolean {
try {
return parseYAMLBoolean(getInput(name, options));
} catch ... {
// Throw the informative error referring to "name" here
}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/core/src/core.ts at getBooleanInput, using the linked lines as the entry point. Separate the YAML boolean parsing into the proposed standalone function while keeping getBooleanInput responsible for the informative error referring to the input name. Done means the parser is independently usable and getBooleanInput still composes it with getInput.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100