From f3db10bae6b7b9641df03acd37d0dcb554d910ea Mon Sep 17 00:00:00 2001 From: provokateurin Date: Tue, 17 Feb 2026 12:43:02 +0100 Subject: [PATCH] feat: Expose PHP version IDs Signed-off-by: provokateurin --- dist/index.js | 15 +++++++++++++++ src/action.js | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/dist/index.js b/dist/index.js index 14727e9..55e01d5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -42616,6 +42616,19 @@ function copy(obj) { return res; } +// Formatted according to PHP_VERSION_ID +function getPHPVersionID(version) { + const parts = version.split('.'); + let value = parseInt(parts[0]) * 10000; + if (parts.length > 1) { + value += parseInt(parts[1]) * 100; + } + if (parts.length > 2) { + value += parseInt(parts[2]); + } + return value.toString(); +} + (async () => { try { @@ -42745,7 +42758,9 @@ function copy(obj) { core.setOutput("branches-max-list", JSON.stringify([branches[branches.length - 1]])); core.setOutput("php-min", php[0]); + core.setOutput("php-min-id", getPHPVersionID(php[0])); core.setOutput("php-max", php[php.length - 1]); + core.setOutput("php-max-id", getPHPVersionID(php[php.length - 1])); core.setOutput("php-available", availablePhp); core.setOutput("branches-min", branches[0]); core.setOutput("branches-max", branches[branches.length - 1]); diff --git a/src/action.js b/src/action.js index 2d08443..cb0763a 100644 --- a/src/action.js +++ b/src/action.js @@ -102,6 +102,19 @@ function copy(obj) { return res; } +// Formatted according to PHP_VERSION_ID +function getPHPVersionID(version) { + const parts = version.split('.'); + let value = parseInt(parts[0]) * 10000; + if (parts.length > 1) { + value += parseInt(parts[1]) * 100; + } + if (parts.length > 2) { + value += parseInt(parts[2]); + } + return value.toString(); +} + (async () => { try { @@ -231,7 +244,9 @@ function copy(obj) { core.setOutput("branches-max-list", JSON.stringify([branches[branches.length - 1]])); core.setOutput("php-min", php[0]); + core.setOutput("php-min-id", getPHPVersionID(php[0])); core.setOutput("php-max", php[php.length - 1]); + core.setOutput("php-max-id", getPHPVersionID(php[php.length - 1])); core.setOutput("php-available", availablePhp); core.setOutput("branches-min", branches[0]); core.setOutput("branches-max", branches[branches.length - 1]);