Skip to content

Commit c04af2b

Browse files
committed
Replace macos-release by (parseInt(os.version()) - 9)
* That way we don't need to update that dependency to work with newer macOS releases.
1 parent 17f5c91 commit c04af2b

File tree

4 files changed

+46
-94
lines changed

4 files changed

+46
-94
lines changed

common.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const core = require('@actions/core')
88
const tc = require('@actions/tool-cache')
99
const { performance } = require('perf_hooks')
1010
const linuxOSInfo = require('linux-os-info')
11-
import macosRelease from 'macos-release'
1211

1312
export const windows = (os.platform() === 'win32')
1413
// Extract to SSD on Windows, see https://github.com/ruby/setup-ruby/pull/14
@@ -239,7 +238,9 @@ export function getOSVersion() {
239238
const info = linuxOSInfo({mode: 'sync'})
240239
osVersion = info.version_id
241240
} else if (platform === 'darwin') {
242-
osVersion = macosRelease().version
241+
// See https://github.com/sindresorhus/macos-release/blob/main/index.js
242+
const darwinVersion = parseInt(os.release().match(/^\d+/)[0])
243+
osVersion = `${darwinVersion - 9}`
243244
} else if (platform === 'win32') {
244245
osVersion = findWindowsVersion()
245246
} else {

dist/index.js

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

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
"@actions/io": "^1.1.2",
2929
"@actions/tool-cache": "^2",
3030
"linux-os-info": "^2.0.0",
31-
"macos-release": "^3.3.0",
3231
"semver": "^7.3.7"
3332
},
3433
"devDependencies": {

yarn.lock

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

0 commit comments

Comments
 (0)