Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Commit

Permalink
Use ruby-version (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
Danny McCormick authored Aug 13, 2019
1 parent 8dd8957 commit c6c44b2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -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
```
Expand Down
6 changes: 4 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
5 changes: 4 additions & 1 deletion lib/setup-ruby.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 4 additions & 1 deletion src/setup-ruby.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c6c44b2

Please sign in to comment.