Ensure an engine-only ruby-version picks the latest stable version and not a preview or RC

This commit is contained in:
Benoit Daloze
2020-11-18 21:52:51 +01:00
parent 34fbbc1d36
commit 7c2bf7263d
3 changed files with 11 additions and 2 deletions
+4
View File
@@ -28,6 +28,10 @@ export function isHeadVersion(rubyVersion) {
return rubyVersion === 'head' || rubyVersion === 'debug' || rubyVersion === 'mingw' || rubyVersion === 'mswin'
}
export function isStableVersion(rubyVersion) {
return /^\d+(\.\d+)*$/.test(rubyVersion)
}
export async function hashFile(file) {
// See https://github.com/actions/runner/blob/master/src/Misc/expressionFunc/hashFiles/src/hashFiles.ts
const hash = crypto.createHash('sha256')