diff --git a/README.md b/README.md index 150f04273..fa465375d 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ jobs: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: - ruby-version: '3.3' # Not needed with a `.ruby-version` or `.tool-versions` + ruby-version: '3.3' # Not needed with a .ruby-version, .tool-versions or mise.toml bundler-cache: true # runs 'bundle install' and caches installed gems automatically - run: bundle exec rake ``` @@ -139,11 +139,12 @@ and the [condition and expression syntax](https://help.github.com/en/actions/ref * engine only like `ruby` and `truffleruby`, uses the latest stable release of that implementation * `.ruby-version` reads from the project's `.ruby-version` file * `.tool-versions` reads from the project's `.tool-versions` file -* If the `ruby-version` input is not specified, `.ruby-version` is tried first, followed by `.tool-versions` +* `mise.toml` reads from the project's `mise.toml` file +* If the `ruby-version` input is not specified, `.ruby-version` is tried first, followed by `.tool-versions`, followed by `mise.toml` ### Working Directory -The `working-directory` input can be set to resolve `.ruby-version`, `.tool-versions` and `Gemfile.lock` +The `working-directory` input can be set to resolve `.ruby-version`, `.tool-versions`, `mise.toml` and `Gemfile.lock` if they are not at the root of the repository, see [action.yml](action.yml) for details. ### RubyGems diff --git a/action.yml b/action.yml index 302149251..3e052125e 100644 --- a/action.yml +++ b/action.yml @@ -6,7 +6,7 @@ branding: icon: download inputs: ruby-version: - description: 'Engine and version to use, see the syntax in the README. Reads from .ruby-version or .tool-versions if unset.' + description: 'Engine and version to use, see the syntax in the README. Reads from .ruby-version, .tool-versions or mise.toml if unset.' default: 'default' rubygems: description: | @@ -26,7 +26,7 @@ inputs: description: 'Run "bundle install", and cache the result automatically. Either true or false.' default: 'false' working-directory: - description: 'The working directory to use for resolving paths for .ruby-version, .tool-versions and Gemfile.lock.' + description: 'The working directory to use for resolving paths for .ruby-version, .tool-versions, mise.toml and Gemfile.lock.' cache-version: description: | Arbitrary string that will be added to the cache key of the bundler cache. Set or change it if you need diff --git a/dist/index.js b/dist/index.js index 931d9e2ee..9c214dee1 100644 --- a/dist/index.js +++ b/dist/index.js @@ -74913,6 +74913,8 @@ function parseRubyEngineAndVersion(rubyVersion) { rubyVersion = '.ruby-version' } else if (fs.existsSync('.tool-versions')) { rubyVersion = '.tool-versions' + } else if (fs.existsSync('mise.toml')) { + rubyVersion = 'mise.toml' } else { throw new Error('input ruby-version needs to be specified if no .ruby-version or .tool-versions file exists') } @@ -74926,6 +74928,11 @@ function parseRubyEngineAndVersion(rubyVersion) { const rubyLine = toolVersions.split(/\r?\n/).filter(e => /^ruby\s/.test(e))[0] rubyVersion = rubyLine.match(/^ruby\s+(.+)$/)[1] 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 rubyLine = toolVersions.split(/\r?\n/).filter(e => /^ruby\s*=\s*/.test(e))[0] + rubyVersion = rubyLine.match(/^ruby\s*=\s*['"](.+)['"]$/)[1] + console.log(`Using ${rubyVersion} as input from file mise.toml`) } let engine, version diff --git a/index.js b/index.js index eb71b4ed2..e50f92dd9 100644 --- a/index.js +++ b/index.js @@ -117,6 +117,8 @@ function parseRubyEngineAndVersion(rubyVersion) { rubyVersion = '.ruby-version' } else if (fs.existsSync('.tool-versions')) { rubyVersion = '.tool-versions' + } else if (fs.existsSync('mise.toml')) { + rubyVersion = 'mise.toml' } else { throw new Error('input ruby-version needs to be specified if no .ruby-version or .tool-versions file exists') } @@ -130,6 +132,11 @@ function parseRubyEngineAndVersion(rubyVersion) { const rubyLine = toolVersions.split(/\r?\n/).filter(e => /^ruby\s/.test(e))[0] rubyVersion = rubyLine.match(/^ruby\s+(.+)$/)[1] 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 rubyLine = toolVersions.split(/\r?\n/).filter(e => /^ruby\s*=\s*/.test(e))[0] + rubyVersion = rubyLine.match(/^ruby\s*=\s*['"](.+)['"]$/)[1] + console.log(`Using ${rubyVersion} as input from file mise.toml`) } let engine, version pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy