Skip to content

Commit ca52189

Browse files
UlisesGasconRafaelGSS
authored andcommitted
feat: extended affectedEnvironments validation to support new values
See: nodejs/security-wg@535ce83
1 parent 6790ed7 commit ca52189

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

action.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ async function run () {
55
// Inputs
66
const nodeVersion = core.getInput('node-version', { required: true })
77
const platform = core.getInput('platform', { required: false })
8-
const availablePlatforms = ['linux', 'win', 'osx', 'smartos', 'aix', 'freebsd']
8+
const availablePlatforms = ["aix", "darwin", "freebsd", "linux", "openbsd", "sunos", "win32", "android"]
99

1010
if (platform && !availablePlatforms.includes(platform)) {
1111
core.setFailed(`platform ${platform} is not valid. Please use ${availablePlatforms.join(',')}.`)

index.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,7 @@ function getVulnerabilityList (currentVersion, data, systemEnvironment) {
8080
return list
8181
}
8282

83-
const getSystemEnvironment = (platform) => {
84-
switch (platform) {
85-
case 'darwin':
86-
return 'osx'
87-
case 'win32':
88-
return 'win'
89-
default:
90-
return 'linux'
91-
}
92-
}
93-
9483
async function main (currentVersion, platform) {
95-
const systemEnvironment = getSystemEnvironment(platform)
9684
const isEOL = await isNodeEOL(currentVersion)
9785
if (isEOL) {
9886
console.error(danger)
@@ -101,7 +89,7 @@ async function main (currentVersion, platform) {
10189
}
10290

10391
const coreIndex = await getCoreIndex()
104-
const list = getVulnerabilityList(currentVersion, coreIndex, systemEnvironment)
92+
const list = getVulnerabilityList(currentVersion, coreIndex, platform)
10593
if (list.length) {
10694
console.error(danger)
10795
console.error(vulnerableWarning + '\n')

0 commit comments

Comments
 (0)