Set default signature verification for supported distributions - #1246
Open
johnoliver wants to merge 2 commits into
Open
Set default signature verification for supported distributions#1246johnoliver wants to merge 2 commits into
johnoliver wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request changes how the action decides whether to verify downloaded JDK signatures by making signature verification default to “on” for distributions that support it (currently Temurin and Microsoft), while keeping it “off” for other distributions unless explicitly enabled/disabled via input.
Changes:
- Makes
verify-signatureinput optional and distinguishes “unset” from an explicit boolean value in input parsing. - Updates distribution installer defaulting so supported distributions automatically enable signature verification when the input is not provided.
- Updates documentation and tests to reflect and validate the new default behavior.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/setup-java.ts | Adds getVerifySignatureInput() and passes verifySignature: boolean | undefined through to installers. |
| src/distributions/base-installer.ts | Defaults signature verification to supportsSignatureVerification() when input is unset. |
| README.md | Documents distribution-dependent defaults for verify-signature. |
| action.yml | Removes the hardcoded default so “unset” can be detected. |
| tests/setup-java.test.ts | Adds orchestration tests for explicit vs unset verify-signature. |
| tests/distributors/temurin-installer.test.ts | Updates Temurin tests to verify “default on” and “explicitly off”. |
| tests/distributors/microsoft-installer.test.ts | Updates Microsoft tests to verify “default on”. |
| dist/setup/index.js | Updates compiled output for setup logic changes. |
| dist/setup/242.index.js | Updates compiled output for base installer defaulting changes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
This pull request updates the Java setup action to change how signature verification is handled for downloaded Java packages. Signature verification is now enabled by default for the
temurinandmicrosoftdistributions, while remaining disabled for others unless explicitly set. The changes also update documentation, input handling, and tests to reflect this new default behavior.Key changes include:
Default Behavior and Input Handling:
verify-signature) now defaults to enabled fortemurinandmicrosoftdistributions, and is disabled for others unless explicitly specified. The input is now optional, and if not provided, the action determines the default based on the distribution. [1] [2] [3]action.ymlandREADME.mdhave been updated to reflect the new default behavior forverify-signature. [1] [2]src/setup-java.tsnow uses a new functiongetVerifySignatureInput()to correctly handle undefined or explicit values forverify-signature. [1] [2] [3]Testing and Validation:
temurinandmicrosoftinstallers have been updated to verify that signature verification is enabled by default, and to check that it can be explicitly disabled when requested. [1] [2] [3] [4]setup-java.test.tshave been updated to check that the correct signature verification value is passed to the distribution based on input and defaults. [1] [2] [3]These changes ensure better security defaults for supported distributions while allowing users to override signature verification behavior as needed.