You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reading version from .ruby-version and Windows support #4
What is the best way of reading ruby version from .ruby-version file?
Something like:
- uses: eregon/use-ruby-action@masterwith:
ruby-version: "$(cat .ruby-version)"# or similar
Also, I didn't want to open an another issue for this but do you plan to support Windows? It would be awesome if we can get the windows builds. Windows support is live. Thank you.
changed the title [-]Reading version from .ruby-version and Windows support[/-][+]Reading version from `.ruby-version` and Windows support[/+]on Jan 5, 2020
Unfortunately I think that syntax doesn't work and GitHub Actions is fairly restrictive on values for with:.
Did you try it to see what happens? I guess the String is passed as-is.
Maybe I should add a special value like ".ruby-version", or I think simpler if ruby-version: is unset look if there is a .ruby-version in the current directory and use that?
For the first question, as you presumed it didn't worked.
And for .ruby-version support will be awesome because, we constantly update our ruby versions and it will be great to see it sync on each CI runs. This way, dependabot and other pull requests that uses another version (outdated) will still work even if we upgrade on master.
P.S.: Thank you so much for this great action and taking care of building ruby for us!
Activity
[-]Reading version from .ruby-version and Windows support[/-][+]Reading version from `.ruby-version` and Windows support[/+]eregon commentedon Jan 5, 2020
Unfortunately I think that syntax doesn't work and GitHub Actions is fairly restrictive on values for
with:.Did you try it to see what happens? I guess the String is passed as-is.
Maybe I should add a special value like
".ruby-version", or I think simpler ifruby-version:is unset look if there is a.ruby-versionin the current directory and use that?gencer commentedon Jan 6, 2020
For the first question, as you presumed it didn't worked.
And for
.ruby-versionsupport will be awesome because, we constantly update our ruby versions and it will be great to see it sync on each CI runs. This way, dependabot and other pull requests that uses another version (outdated) will still work even if we upgrade onmaster.P.S.: Thank you so much for this great action and taking care of building ruby for us!
eregon commentedon Jan 6, 2020
Could you give me an example of the format you use for
.ruby-version?Something like
ruby-2.6.5?eregon commentedon Jan 6, 2020
It works with a61be15, thank you for the suggestion.
I updated the README to document this.
Using
should be enough if there is a
.ruby-versionfile.You can also set it explicitly to
.ruby-version:gencer commentedon Jan 7, 2020
@eregon Thank you one more time for quick solution on this case. First option is the most cleaner. I always have
.ruby-versionon root.Have a nice week!
Read from .ruby-version if version is unset or set to '.ruby-version'