From 05b0430d2d0525a63c8ea5bc7d09fc0e14911520 Mon Sep 17 00:00:00 2001 From: Remi Cattiau Date: Thu, 29 Aug 2024 21:56:07 -0700 Subject: [PATCH] fix: allow to pick which version to use by only removing platform_version for this version --- action.yml | 4 ++-- dist/setup/index.js | 5 ++++- src/install-python.ts | 7 ++++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 3c44cd9..6ee88fe 100644 --- a/action.yml +++ b/action.yml @@ -27,8 +27,8 @@ inputs: description: "When 'true', a version range passed to 'python-version' input will match prerelease versions if no GA versions are found. Only 'x.y' version range is supported for CPython." default: false ignore-platform-version: - description: "Ignore the platform version to allow usage on Debian" - default: false + description: "Ignore the specific platform version to allow usage on Debian" + default: "" required: false outputs: python-version: diff --git a/dist/setup/index.js b/dist/setup/index.js index 2b2d389..b036654 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -71732,7 +71732,10 @@ function getManifest() { // Display each tool manifest.forEach(tool => { tool.files.forEach(f => { - f.platform_version = undefined; + if (f.platform_version === core.getInput('ignore-platform-version') || + 'all' === core.getInput('ignore-platform-version')) { + f.platform_version = undefined; + } }); }); } diff --git a/src/install-python.ts b/src/install-python.ts index f414ee2..ba7436e 100644 --- a/src/install-python.ts +++ b/src/install-python.ts @@ -40,7 +40,12 @@ export async function getManifest(): Promise { // Display each tool manifest.forEach(tool => { tool.files.forEach(f => { - f.platform_version = undefined; + if ( + f.platform_version === core.getInput('ignore-platform-version') || + 'all' === core.getInput('ignore-platform-version') + ) { + f.platform_version = undefined; + } }); }); }