@@ -92090,6 +92090,9 @@ function getOSInfo() {
9209092090 });
9209192091}
9209292092exports.getOSInfo = getOSInfo;
92093+ function isString(value) {
92094+ return typeof value === 'string' || value instanceof String;
92095+ }
9209392096/**
9209492097 * Extract a value from an object by following the keys path provided.
9209592098 * If the value is present, it is returned. Otherwise undefined is returned.
@@ -92100,9 +92103,12 @@ function extractValue(obj, keys) {
9210092103 if (keys.length > 1 && value !== undefined) {
9210192104 return extractValue(value, keys.slice(1));
9210292105 }
92103- else {
92106+ else if (isString(value)) {
9210492107 return value;
9210592108 }
92109+ else {
92110+ return;
92111+ }
9210692112 }
9210792113 else {
9210892114 return;
@@ -92122,19 +92128,26 @@ function getVersionInputFromTomlFile(versionFile) {
9212292128 // Normalize the line endings in the pyprojectFile
9212392129 pyprojectFile = pyprojectFile.replace(/\r\n/g, '\n');
9212492130 const pyprojectConfig = toml.parse(pyprojectFile);
92125- let keys = [];
92131+ let keyPaths = [];
9212692132 if ('project' in pyprojectConfig) {
9212792133 // standard project metadata (PEP 621)
92128- keys = ['project', 'requires-python'];
92134+ keyPaths = [[ 'project', 'requires-python'] ];
9212992135 }
9213092136 else {
92131- // python poetry
92132- keys = ['tool', 'poetry', 'dependencies', 'python'];
92137+ keyPaths = [
92138+ // python poetry
92139+ ['tool', 'poetry', 'dependencies', 'python'],
92140+ // mise
92141+ ['tools', 'python'],
92142+ ['tools', 'python', 'version']
92143+ ];
9213392144 }
9213492145 const versions = [];
92135- const version = extractValue(pyprojectConfig, keys);
92136- if (version !== undefined) {
92137- versions.push(version);
92146+ for (const keys of keyPaths) {
92147+ const value = extractValue(pyprojectConfig, keys);
92148+ if (value !== undefined) {
92149+ versions.push(value);
92150+ }
9213892151 }
9213992152 core.info(`Extracted ${versions} from ${versionFile}`);
9214092153 const rawVersions = Array.from(versions, version => version.split(',').join(' '));
0 commit comments