Skip to content

Reading version from .ruby-version and Windows support #4

Closed

Description

@gencer

What is the best way of reading ruby version from .ruby-version file?

Something like:

      - uses: eregon/use-ruby-action@master
        with:
          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.

Activity

  1. changed the title [-]Reading version from .ruby-version and Windows support[/-] [+]Reading version from `.ruby-version` and Windows support[/+] on Jan 5, 2020
  2. eregon commented on Jan 5, 2020

    @eregon
    Member

    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?

  3. self-assigned this
    on Jan 5, 2020
  4. gencer commented on Jan 6, 2020

    @gencer
    Author

    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!

  5. eregon commented on Jan 6, 2020

    @eregon
    Member

    Could you give me an example of the format you use for .ruby-version?
    Something like ruby-2.6.5?

  6. eregon commented on Jan 6, 2020

    @eregon
    Member

    It works with a61be15, thank you for the suggestion.
    I updated the README to document this.

    Using

        - uses: eregon/use-ruby-action@master

    should be enough if there is a .ruby-version file.

    You can also set it explicitly to .ruby-version:

        - uses: eregon/use-ruby-action@master
          with:
            ruby-version: .ruby-version
  7. gencer commented on Jan 7, 2020

    @gencer
    Author

    @eregon Thank you one more time for quick solution on this case. First option is the most cleaner. I always have .ruby-version on root.

    Have a nice week!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions