Skip to content

Commit d82eaf0

Browse files
UlisesGasconRafaelGSS
authored andcommitted
chore: github action build
1 parent 115163b commit d82eaf0

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

dist/index.js

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,23 +62,23 @@ const CORE_RAW_URL = 'https://raw.githubusercontent.com/nodejs/security-wg/main/
6262

6363
let lastETagValue
6464

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"
6767

6868
async function readLocal (file) {
6969
return require(file)
7070
}
7171

7272
function loadETag () {
73-
if (fs.existsSync(ETagFile)) {
73+
if (fs.existsSync(__nccwpck_require__.ab + ".etag")) {
7474
debug('Loading local ETag')
7575
lastETagValue = fs.readFileSync(ETagFile).toString()
7676
}
7777
}
7878

7979
function updateLastETag (etag) {
8080
lastETagValue = etag
81-
fs.writeFileSync(ETagFile, lastETagValue)
81+
fs.writeFileSync(__nccwpck_require__.ab + ".etag", lastETagValue)
8282
}
8383

8484
async function fetchCoreIndex () {
@@ -89,20 +89,20 @@ async function fetchCoreIndex () {
8989
abortRequest.emit('abort')
9090
process.nextTick(() => { process.exit(1) })
9191
}
92-
return fs.createWriteStream(coreLocalFile, { flags: 'w', autoClose: true })
92+
return fs.createWriteStream(__nccwpck_require__.ab + "core.json", { flags: 'w', autoClose: true })
9393
})
94-
return readLocal(coreLocalFile)
94+
return readLocal(__nccwpck_require__.ab + "core.json")
9595
}
9696

9797
async function getCoreIndex () {
9898
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")) {
100100
updateLastETag(headers.etag)
101101
debug('Creating local core.json')
102102
return fetchCoreIndex()
103103
} else {
104104
debug(`No updates from upstream. Getting a cached version: ${coreLocalFile}`)
105-
return readLocal(coreLocalFile)
105+
return readLocal(__nccwpck_require__.ab + "core.json")
106106
}
107107
}
108108

@@ -41513,20 +41513,23 @@ module.exports = require("zlib");
4151341513
var __webpack_exports__ = {};
4151441514
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
4151541515
(() => {
41516-
const core = __nccwpck_require__(2186);
41516+
const core = __nccwpck_require__(2186)
4151741517
const { isNodeVulnerable } = __nccwpck_require__(2932)
4151841518

4151941519
async function run () {
41520-
4152141520
// Inputs
4152241521
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!`)
4152541528
}
41526-
4152741529
}
4152841530

4152941531
run()
41532+
4153041533
})();
4153141534

4153241535
module.exports = __webpack_exports__;

0 commit comments

Comments
 (0)