1
0
Fork 0
mirror of https://github.com/actions/setup-python.git synced 2024-12-25 21:50:45 +00:00

feat: added python-version-strategy config option, to enable enforcing use of the lowest supported (approximate) version

This commit is contained in:
Erik Bjäreholt 2023-12-06 10:53:46 +01:00 committed by GitHub
parent 0a5c615913
commit 6d804ec3f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}