diff --git a/dist/index.js b/dist/index.js index 801b222ca..74b51ee70 100644 --- a/dist/index.js +++ b/dist/index.js @@ -92559,7 +92559,7 @@ function parseRubyEngineAndVersion(rubyVersion) { console.log(`Using ${rubyVersion} as input from file .tool-versions`) } else if (rubyVersion === 'mise.toml') { // Read from mise.toml const toolVersions = fs.readFileSync('mise.toml', 'utf8').trim() - const regexp = /^ruby\s*=\s*['"](.+)['"]$/ + const regexp = /^\s*ruby\s*=\s*['"]([^'"]+)['"]\s*(?:#.*)?$/ const rubyLine = toolVersions.split(/\r?\n/).filter(e => regexp.test(e))[0] rubyVersion = rubyLine.match(regexp)[1] console.log(`Using ${rubyVersion} as input from file mise.toml`) diff --git a/index.js b/index.js index 29c753d1e..7fdcf5b3e 100644 --- a/index.js +++ b/index.js @@ -130,7 +130,7 @@ function parseRubyEngineAndVersion(rubyVersion) { console.log(`Using ${rubyVersion} as input from file .tool-versions`) } else if (rubyVersion === 'mise.toml') { // Read from mise.toml const toolVersions = fs.readFileSync('mise.toml', 'utf8').trim() - const regexp = /^ruby\s*=\s*['"](.+)['"]$/ + const regexp = /^\s*ruby\s*=\s*['"]([^'"]+)['"]\s*(?:#.*)?$/ const rubyLine = toolVersions.split(/\r?\n/).filter(e => regexp.test(e))[0] rubyVersion = rubyLine.match(regexp)[1] console.log(`Using ${rubyVersion} as input from file mise.toml`)