forked from actions/setup-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.ts
More file actions
34 lines (28 loc) · 913 Bytes
/
Copy pathmain.ts
File metadata and controls
34 lines (28 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import * as core from '@actions/core';
import * as cache from './cache';
export async function run() {
try {
core.info('------------------------');
core.info('NOTE: This action is deprecated and is no longer maintained.');
core.info(
'Please, migrate to https://github.com/ruby/setup-ruby, which is being actively maintained.'
);
core.info('------------------------');
let versionSpec = core.getInput('ruby-version', {required: true});
if (!versionSpec) {
// deprecated
versionSpec = core.getInput('version');
}
// check in the VMs cache first
let toolPath: string = await cache.find(versionSpec);
// TODO: download JIT and/or ruby-build
if (!toolPath) {
core.setFailed(`Version ${versionSpec} not found`);
return;
}
core.addPath(toolPath);
} catch (error) {
// unhandled
core.setFailed(error.message);
}
}