From 6d804ec3f0d57f3de05a8f152bf87c0972b39ee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Bj=C3=A4reholt?= Date: Wed, 6 Dec 2023 10:53:46 +0100 Subject: [PATCH] feat: added python-version-strategy config option, to enable enforcing use of the lowest supported (approximate) version --- src/setup-python.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/setup-python.ts b/src/setup-python.ts index 0dd45f0ca..629d45634 100644 --- a/src/setup-python.ts +++ b/src/setup-python.ts @@ -53,6 +53,7 @@ function resolveVersionInputFromDefaultFile(): string[] { function resolveVersionInput() { let versions = core.getMultilineInput('python-version'); const versionFile = core.getInput('python-version-file'); + const versionStrategy = core.getInput('python-version-strategy'); if (versions.length) { if (versionFile) { @@ -73,6 +74,9 @@ function resolveVersionInput() { } } + if(versionStrategy == "approximate") + versions.map(v => v.replace(">=", "~").replace("^", "~")); + return versions; }