Skip to content

Fix alpine failures by switching default back to only warn on verific… - #1261

Closed
brunoborges wants to merge 2 commits into
actions:mainfrom
johnoliver:fix-alpine
Closed

Fix alpine failures by switching default back to only warn on verific…#1261
brunoborges wants to merge 2 commits into
actions:mainfrom
johnoliver:fix-alpine

Conversation

@brunoborges

Copy link
Copy Markdown
Contributor

…ation failures. To prevent build failures due to missing GPG or rotated vendor keys.

Also allow multiple GPG keys to be provided.

Description:
Describe your changes.

Related issue:
Add link to the related issue.

Check list:

  • Ran npm run check locally (format, lint, build, test) and all checks pass.
  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

…ation failures. To prevent build failures due to missing GPG or rotated vendor keys.

Also allow multiple GPG keys to be provided.
@brunoborges
brunoborges requested a review from a team as a code owner September 3, 2026 17:11
Copilot AI lite review requested due to automatic review settings September 3, 2026 17:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

It changes default signature-verification enforcement (security-sensitive behavior) and cache-key identity, so a final human review is needed.

Review tier: Lite
Findings: 2 Low severity

New issues introduced by this change (2)
Severity Finding
Low severity src/​distributions/​microsoft/​installer.ts — This message can be produced in the default (implicit) signature-check mode when verify-signature
Low severity src/​distributions/​temurin/​installer.ts — This message can be surfaced even when the user did not set verify-signature (because signature…
What changed in this PR

This PR adjusts how actions/setup-java handles JDK package signature verification (especially on Alpine), making the default behavior non-fatal (warn-only) while still allowing users to explicitly enforce verification failures as fatal. It also broadens key support to allow multiple GPG keys and updates caching identity logic and documentation accordingly.

Changes:

  • Introduces an explicit “enforced vs check-and-warn” signature verification policy, with enforcement only when verify-signature: true is explicitly set.
  • Allows providing multiple public keys for signature verification and updates the JDK cache identity to reflect verification policy + key set.
  • Updates docs/tests and rebuilds dist/ bundles to match runtime behavior.
File Description
src/​jdk-cache.ts Extends verification identity to include policy (disabled/check-and-warn/enforced) and fingerprints multi-key sets.
src/​gpg.ts Adds isGpgAvailable() and updates signature verification to accept/import multiple keys.
src/​distributions/​temurin/​installer.ts Makes implicit verification warn-only, adds gpg availability check, and improves failure guidance.
src/​distributions/​microsoft/​installer.ts Makes implicit verification warn-only and adds failure guidance for key rotation scenarios.
src/​distributions/​local/​installer.ts Updates cache identity callsite to new verification identity signature.
src/​distributions/​base-models.ts Introduces SignatureVerificationKey type and updates installer options accordingly.
src/​distributions/​base-installer.ts Tracks whether verification was explicitly requested and threads that into cache identity.
src/​constants.ts Adds documentation URL + standardized “key rotation / disable verification” help text.
README.md Updates user-facing docs for default behavior, enforcement semantics, and multi-key input guidance.
docs/​advanced-usage.md Documents updated verification identity semantics and links to signature docs section.
action.yml Updates input descriptions to reflect warn-by-default vs explicitly-enforced verification behavior.
tests/​jdk-cache.test.ts Updates/expands tests for verification policy separation and multi-key fingerprinting behavior.
tests/​gpg.test.ts Updates tests for multiple key import behavior and new key file naming.
tests/​distributors/​temurin-installer.test.ts Adds coverage for implicit vs explicit behavior and gpg-unavailable behavior.
tests/​distributors/​microsoft-installer.test.ts Adds coverage for implicit warnings vs explicit failures and missing signature behavior.
tests/​distributors/​local-installer.test.ts Updates expectations for new “disabled” verification identity string.
tests/​distributors/​base-installer.test.ts Updates mocks/expectations for new verification identity signature and values.
tests/​cleanup-java.test.ts Updates expectations for new “disabled” verification identity string.
dist/​setup/​index.js Rebuilt bundle reflecting constants export additions and new verification behavior.
dist/​setup/​81.index.js Rebuilt bundle reflecting isGpgAvailable() and multi-key import behavior.
dist/​setup/​779.index.js Rebuilt bundle reflecting updated verification identity calculation.
dist/​setup/​463.index.js Rebuilt bundle reflecting Temurin warn-vs-fail behavior and gpg check.
dist/​setup/​242.index.js Rebuilt bundle reflecting verifySignatureExplicitlyRequested propagation into cache identity.
dist/​setup/​220.index.js Rebuilt bundle reflecting Microsoft warn-vs-fail behavior and guidance text.
dist/​setup/​19.index.js Rebuilt bundle reflecting local installer “disabled” verification identity.
dist/​cleanup/​index.js Rebuilt cleanup bundle reflecting gpg changes and constants export additions.
dist/​cleanup/​314.index.js Rebuilt cleanup bundle reflecting updated verification identity calculation.
Suppressed comments (1)

src/distributions/temurin/installer.ts:156

  • Similar to the gpg-unavailable case, this error text can be emitted as a warning even when verify-signature was omitted (default check-and-warn mode). Consider adjusting the wording to distinguish implicit verification from explicitly requested enforcement, to avoid confusing users who didn’t set the input.
        if (!release.signatureUrl) {
          throw new Error(
            `Input 'verify-signature' is enabled, but no signature URL was found for Temurin version ${release.version}.`
          );

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +39 to +42
if (!javaRelease.signatureUrl) {
throw new Error(
`Input 'verify-signature' is enabled, but no signature URL was found for Microsoft Build of OpenJDK version ${javaRelease.version}.`
);
Comment on lines +148 to +151
if (!(await gpg.isGpgAvailable())) {
throw new Error(
"Input 'verify-signature' is enabled, but gpg is not available."
);
@brunoborges brunoborges closed this Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants