Skip to content

Commit c5d9dd9

Browse files
committed
rubygems: latest - don't update RubyGems for Ruby head builds & Ruby < 2.2
1 parent de7e507 commit c5d9dd9

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ inputs:
1212
description: |
1313
The version of RubyGems to use. Either 'default' (the default), 'latest', or a version number (e.g., 3.3.5).
1414
For 'default', no action is taken and the version of RubyGems that comes with Ruby by default is used.
15-
For 'latest', `gem update --system` is run to update to the latest RubyGems version.
15+
For 'latest', `gem update --system` is run to update to the proper latest RubyGems version. Ruby head/master builds and Ruby 2.2 and earlier will not be updated.
1616
Similarly, if a version number is given, `gem update --system <version>` is run to update to that version of RubyGems, as long as that version is newer than the one provided by default.
1717
bundler:
1818
description: |

dist/index.js

+4-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rubygems.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const common = require('./common')
12
const path = require('path')
23
const exec = require('@actions/exec')
34
const semver = require('semver')
@@ -31,7 +32,9 @@ export async function rubygemsUpdate(rubygemsVersionInput, rubyPrefix, platform,
3132

3233
async function rubygemsLatest(gem, platform, engine, version) {
3334
if (engine === 'ruby') {
34-
if (version >= '3.0') {
35+
if (common.isHeadVersion(version)) {
36+
console.log('Ruby master builds use included RubyGems')
37+
} else if (version >= '3.0') {
3538
await exec.exec(gem, ['update', '--system'])
3639
} else if (version >= '2.6') {
3740
await exec.exec(gem, ['update', '--system', '3.4.22'])

0 commit comments

Comments
 (0)