mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-14 06:54:20 +02:00
Read from .ruby-version if version is unset or set to '.ruby-version'
* Fixes https://github.com/eregon/use-ruby-action/issues/4
This commit is contained in:
@@ -47,6 +47,11 @@ async function getLatestReleaseTag() {
|
||||
}
|
||||
|
||||
async function getRubyEngineAndVersion(rubyVersion) {
|
||||
if (rubyVersion === '.ruby-version') { // Read from .ruby-version
|
||||
rubyVersion = fs.readFileSync('.ruby-version', 'utf8').trim()
|
||||
console.log(`Using ${rubyVersion} as input from file .ruby-version`)
|
||||
}
|
||||
|
||||
let engine, version
|
||||
if (rubyVersion.match(/^\d+/)) { // X.Y.Z => ruby-X.Y.Z
|
||||
engine = 'ruby'
|
||||
|
||||
Reference in New Issue
Block a user