From c6c44b217af18a8b984718464f19b86ac4d1b444 Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Tue, 13 Aug 2019 16:29:23 -0400 Subject: [PATCH] Use ruby-version (#10) --- README.md | 4 ++-- action.yml | 6 ++++-- lib/setup-ruby.js | 5 ++++- src/setup-ruby.ts | 5 ++++- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3188c5e..8ea0577 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ steps: - uses: actions/checkout@master - uses: actions/setup-ruby@v1 with: - version: '2.x' // Version range or exact version of a Ruby version to use, using semvers version range syntax. + ruby-version: '2.x' // Version range or exact version of a Ruby version to use, using semvers version range syntax. - run: ruby hello.rb ``` @@ -37,7 +37,7 @@ jobs: - name: Setup ruby uses: actions/setup-ruby@v1 with: - version: ${{ matrix.ruby }} + ruby-version: ${{ matrix.ruby }} architecture: 'x64' - run: ruby hello.rb ``` diff --git a/action.yml b/action.yml index 0d32b3f..e763fd0 100644 --- a/action.yml +++ b/action.yml @@ -2,10 +2,12 @@ name: 'Setup Ruby environment' description: 'Setup a Ruby environment and add it to the PATH' author: 'GitHub' inputs: - version: + ruby-version: description: 'Version range or exact version of a Ruby version to use.' default: '>= 2.4' - +# Deprecated option, do not use. Will not be supported after October 1, 2019 + version: + description: 'Deprecated. Use ruby-version instead. Will not be supported after October 1, 2019' runs: using: 'node12' main: 'lib/setup-ruby.js' diff --git a/lib/setup-ruby.js b/lib/setup-ruby.js index cc7f5fd..acad2f4 100644 --- a/lib/setup-ruby.js +++ b/lib/setup-ruby.js @@ -20,7 +20,10 @@ const installer_1 = require("./installer"); function run() { return __awaiter(this, void 0, void 0, function* () { try { - const version = core.getInput('version'); + let version = core.getInput('version'); + if (!version) { + version = core.getInput('ruby-version'); + } yield installer_1.findRubyVersion(version); } catch (error) { diff --git a/src/setup-ruby.ts b/src/setup-ruby.ts index 5d482d3..ddafe47 100644 --- a/src/setup-ruby.ts +++ b/src/setup-ruby.ts @@ -3,7 +3,10 @@ import {findRubyVersion} from './installer'; async function run() { try { - const version = core.getInput('version'); + let version = core.getInput('version'); + if (!version) { + version = core.getInput('ruby-version'); + } await findRubyVersion(version); } catch (error) { core.setFailed(error.message);