Reject invalid boolean input values - #1160
Merged
brunoborges merged 1 commit intoJul 29, 2026
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c6daa6b5-31f5-46b2-a994-b8320b50a50d
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens boolean input parsing in actions/setup-java so typos like ture no longer silently evaluate as false, aligning behavior with the linked issue (#1157) and improving input validation consistency across the action.
Changes:
- Updated the shared
getBooleanInputhelper to accept only case-insensitivetrue/false, preserve default handling, and throw a descriptive error on invalid values. - Rebuilt the checked-in
dist/setupanddist/cleanupbundles to reflect the TypeScript change. - Added unit tests covering casing, whitespace, defaults, and invalid values across the seven boolean inputs.
Show a summary per file
| File | Description |
|---|---|
| src/util.ts | Implements strict boolean parsing and improved validation error reporting. |
| dist/setup/index.js | Rebuilt bundle reflecting the updated boolean parsing logic. |
| dist/cleanup/index.js | Rebuilt bundle reflecting the updated boolean parsing logic. |
| tests/util.test.ts | Adds test coverage for valid/invalid boolean inputs, casing, whitespace, and defaults. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/4 changed files
- Comments generated: 1
- Review effort level: Low
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Boolean input typos currently fall through as
false, which can silently disable requested behavior. This change makes the shared parser accept only case-insensitivetrueorfalse, preserves existing defaults and whitespace handling, and reports the input name and invalid value for unsupported values.The stricter behavior applies consistently to all seven boolean inputs that use the helper. The checked-in setup and cleanup bundles are rebuilt to match the TypeScript source.
Related issue:
Fixes: #1157
Check list:
npm run checklocally (format, lint, build, test) and all checks pass.