Skip to content

Commit

Permalink
Replace macos-release by (parseInt(os.version()) - 9)
Browse files Browse the repository at this point in the history
* That way we don't need to update that dependency to work with newer macOS releases.
  • Loading branch information
eregon committed Sep 25, 2024
1 parent 17f5c91 commit c04af2b
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 94 deletions.
5 changes: 3 additions & 2 deletions common.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const core = require('@actions/core')
const tc = require('@actions/tool-cache')
const { performance } = require('perf_hooks')
const linuxOSInfo = require('linux-os-info')
import macosRelease from 'macos-release'

export const windows = (os.platform() === 'win32')
// Extract to SSD on Windows, see https://github.com/ruby/setup-ruby/pull/14
Expand Down Expand Up @@ -239,7 +238,9 @@ export function getOSVersion() {
const info = linuxOSInfo({mode: 'sync'})
osVersion = info.version_id
} else if (platform === 'darwin') {
osVersion = macosRelease().version
// See https://github.com/sindresorhus/macos-release/blob/main/index.js
const darwinVersion = parseInt(os.release().match(/^\d+/)[0])
osVersion = `${darwinVersion - 9}`
} else if (platform === 'win32') {
osVersion = findWindowsVersion()
} else {
Expand Down
129 changes: 43 additions & 86 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"@actions/io": "^1.1.2",
"@actions/tool-cache": "^2",
"linux-os-info": "^2.0.0",
"macos-release": "^3.3.0",
"semver": "^7.3.7"
},
"devDependencies": {
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c04af2b

Please sign in to comment.