From cf277c60eb25467037889841efdb72551f06f6c3 Mon Sep 17 00:00:00 2001 From: Bruno Borges Date: Tue, 4 Aug 2026 11:48:38 -0400 Subject: [PATCH] Deprecate setup-java v4 (#1194) Add a deprecation message to the v4 action metadata and emit a runtime warning that v4 will no longer receive updates, directing users to migrate to setup-java v5. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c8931f2e-fb40-497a-b529-be37cb97a0ae --- action.yml | 1 + dist/setup/index.js | 2 ++ src/setup-java.ts | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/action.yml b/action.yml index fc2a6fae..1d72ba08 100644 --- a/action.yml +++ b/action.yml @@ -1,6 +1,7 @@ name: 'Setup Java JDK' description: 'Set up a specific version of the Java JDK and add the command-line tools to the PATH' +deprecationMessage: 'setup-java v4 is deprecated and will no longer receive updates. Please migrate to actions/setup-java@v5.' author: 'GitHub' inputs: java-version: diff --git a/dist/setup/index.js b/dist/setup/index.js index 49bfb8d8..526ab711 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -136768,9 +136768,11 @@ const constants = __importStar(__nccwpck_require__(69042)); const cache_1 = __nccwpck_require__(64810); const path = __importStar(__nccwpck_require__(71017)); const distribution_factory_1 = __nccwpck_require__(10924); +const DEPRECATION_WARNING = 'setup-java v4 is deprecated and will no longer receive updates. Please migrate to actions/setup-java@v5.'; function run() { return __awaiter(this, void 0, void 0, function* () { try { + core.warning(DEPRECATION_WARNING); const versions = core.getMultilineInput(constants.INPUT_JAVA_VERSION); const distributionName = core.getInput(constants.INPUT_DISTRIBUTION, { required: true diff --git a/src/setup-java.ts b/src/setup-java.ts index 73baf33a..06aebedb 100644 --- a/src/setup-java.ts +++ b/src/setup-java.ts @@ -13,8 +13,13 @@ import * as path from 'path'; import {getJavaDistribution} from './distributions/distribution-factory'; import {JavaInstallerOptions} from './distributions/base-models'; +const DEPRECATION_WARNING = + 'setup-java v4 is deprecated and will no longer receive updates. Please migrate to actions/setup-java@v5.'; + async function run() { try { + core.warning(DEPRECATION_WARNING); + const versions = core.getMultilineInput(constants.INPUT_JAVA_VERSION); const distributionName = core.getInput(constants.INPUT_DISTRIBUTION, { required: true