@@ -62,23 +62,23 @@ const CORE_RAW_URL = 'https://raw.githubusercontent.com/nodejs/security-wg/main/
62
62
63
63
let lastETagValue
64
64
65
- const coreLocalFile = path.join(__dirname, ' core.json')
66
- const ETagFile = path.join(__dirname, ' .etag')
65
+ const coreLocalFile = __nccwpck_require__.ab + " core.json"
66
+ const ETagFile = __nccwpck_require__.ab + " .etag"
67
67
68
68
async function readLocal (file) {
69
69
return require(file)
70
70
}
71
71
72
72
function loadETag () {
73
- if (fs.existsSync(ETagFile )) {
73
+ if (fs.existsSync(__nccwpck_require__.ab + ".etag" )) {
74
74
debug('Loading local ETag')
75
75
lastETagValue = fs.readFileSync(ETagFile).toString()
76
76
}
77
77
}
78
78
79
79
function updateLastETag (etag) {
80
80
lastETagValue = etag
81
- fs.writeFileSync(ETagFile , lastETagValue)
81
+ fs.writeFileSync(__nccwpck_require__.ab + ".etag" , lastETagValue)
82
82
}
83
83
84
84
async function fetchCoreIndex () {
@@ -89,20 +89,20 @@ async function fetchCoreIndex () {
89
89
abortRequest.emit('abort')
90
90
process.nextTick(() => { process.exit(1) })
91
91
}
92
- return fs.createWriteStream(coreLocalFile , { flags: 'w', autoClose: true })
92
+ return fs.createWriteStream(__nccwpck_require__.ab + "core.json" , { flags: 'w', autoClose: true })
93
93
})
94
- return readLocal(coreLocalFile )
94
+ return readLocal(__nccwpck_require__.ab + "core.json" )
95
95
}
96
96
97
97
async function getCoreIndex () {
98
98
const { headers } = await request(CORE_RAW_URL, { method: 'HEAD' })
99
- if (!lastETagValue || lastETagValue !== headers.etag || !fs.existsSync(coreLocalFile )) {
99
+ if (!lastETagValue || lastETagValue !== headers.etag || !fs.existsSync(__nccwpck_require__.ab + "core.json" )) {
100
100
updateLastETag(headers.etag)
101
101
debug('Creating local core.json')
102
102
return fetchCoreIndex()
103
103
} else {
104
104
debug(`No updates from upstream. Getting a cached version: ${coreLocalFile}`)
105
- return readLocal(coreLocalFile )
105
+ return readLocal(__nccwpck_require__.ab + "core.json" )
106
106
}
107
107
}
108
108
@@ -41513,20 +41513,23 @@ module.exports = require("zlib");
41513
41513
var __webpack_exports__ = {};
41514
41514
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
41515
41515
(() => {
41516
- const core = __nccwpck_require__(2186);
41516
+ const core = __nccwpck_require__(2186)
41517
41517
const { isNodeVulnerable } = __nccwpck_require__(2932)
41518
41518
41519
41519
async function run () {
41520
-
41521
41520
// Inputs
41522
41521
const nodeVersion = core.getInput('node-version', { required: true })
41523
- if(isNodeVulnerable(nodeVersion)){
41524
- core.setFailed(`Node.js version ${nodeVersion} is vulnerable`)
41522
+ core.info(`Checking Node.js version ${nodeVersion}...`)
41523
+ const isVulnerable = await isNodeVulnerable(nodeVersion)
41524
+ if (isVulnerable) {
41525
+ core.setFailed(`Node.js version ${nodeVersion} is vulnerable. Please upgrade!`)
41526
+ } else {
41527
+ core.info(`Node.js version ${nodeVersion} is OK!`)
41525
41528
}
41526
-
41527
41529
}
41528
41530
41529
41531
run()
41532
+
41530
41533
})();
41531
41534
41532
41535
module.exports = __webpack_exports__;
0 commit comments