Skip to content

Add force-download option for reproducible JDK builds - #1148

Merged
brunoborges merged 4 commits into
mainfrom
copilot/add-force-download-option
Jul 28, 2026
Merged

Add force-download option for reproducible JDK builds#1148
brunoborges merged 4 commits into
mainfrom
copilot/add-force-download-option

Conversation

CopilotAI commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Description:
Runner-cached JDKs may contain system-modified certificate stores, producing non-reproducible runtime images.

  • Add force-download to bypass and replace matching tool-cache installations.
  • Apply the behavior to downloaded distributions and jdkfile.
  • Document the input and add cache-bypass coverage.
with:
distribution: temurinjava-version: '25.0.2'force-download: true

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.

CopilotAI changed the title [WIP] Add force-download option for reproducible buildsAdd force-download option for reproducible JDK buildsJul 28, 2026
CopilotAI requested a review from brunoborgesJuly 28, 2026 02:27
@brunoborges
brunoborges marked this pull request as ready for review July 28, 2026 04:38
@brunoborges
brunoborges requested a review from a team as a code ownerJuly 28, 2026 04:38
CopilotAI review requested due to automatic review settings July 28, 2026 04:38

CopilotAI 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.

Pull request overview

Adds a new force-download input to actions/setup-java to bypass potentially system-modified runner tool-cache JDKs (e.g., modified cacerts) and ensure reproducible JDK artifacts by always downloading/unpacking and re-caching the requested version.

Changes:

  • Introduces force-download input plumbing (constants, action.yml, README) and passes it through installer options.
  • Updates the base installer and jdkfile (local) distribution to skip tool-cache resolution when force-download is enabled.
  • Adds unit tests covering cache-bypass behavior and updates bundled dist/* artifacts.
Show a summary per file
FileDescription
src/setup-java.tsReads force-download input and forwards it into JavaInstallerOptions.
src/distributions/local/installer.tsSkips tool-cache resolution for jdkfile installs when force-download is enabled.
src/distributions/base-models.tsExtends installer options model with forceDownload.
src/distributions/base-installer.tsImplements tool-cache bypass in the common installer flow and ensures latest-resolution doesn’t fall back to cache when forced.
src/constants.tsAdds INPUT_FORCE_DOWNLOAD constant.
README.mdDocuments the new force-download input and its reproducibility motivation.
action.ymlDeclares force-download input for the action.
tests/distributors/local-installer.test.tsAdds coverage for jdkfile extraction path when force-download is enabled.
tests/distributors/base-installer.test.tsAdds coverage ensuring tool-cache lookup is skipped when force-download is enabled.
dist/setup/index.jsUpdates bundled action output to include force-download behavior.
dist/cleanup/index.jsUpdates bundled cleanup output to include the new constant.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comments suppressed due to low confidence (1)

src/distributions/local/installer.ts:35

  • When force-download is enabled, the tool-cache lookup is intentionally skipped, but the log message in the else branch still says the version "was not found in tool-cache". This is misleading for users trying to understand why a cached JDK wasn’t used.
 let foundJava = this.forceDownload ? null : this.findInToolcache();
if (foundJava) {
core.info(`Resolved Java ${foundJava.version} from tool-cache`);
} else {
  • Files reviewed: 9/11 changed files
  • Comments generated: 0
  • Review effort level: Low

@brunoborges
brunoborges merged commit 089b010 into mainJul 28, 2026
441 checks passed
@brunoborges
brunoborges deleted the copilot/add-force-download-option branch July 28, 2026 18:43
Sign up for freeto 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.

Add force-download option for reproducible builds

3 participants

@brunoborges