From 028e7ad27ccd5b936315f0f1b75f905766a66b05 Mon Sep 17 00:00:00 2001 From: JS-Jake Date: Thu, 14 Jul 2022 13:22:42 +0100 Subject: [PATCH] Dont be an ESModule --- dist/index.js | 99 +++++++++++++++++++++++++++------------------------ index.js | 4 +-- package.json | 1 - 3 files changed, 54 insertions(+), 50 deletions(-) diff --git a/dist/index.js b/dist/index.js index e5ace5d..4f6dd5d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,5 +1,5 @@ -import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; -/******/ var __webpack_modules__ = ({ +/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({ /***/ 889: /***/ ((module) => { @@ -7,65 +7,70 @@ import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; module.exports = eval("require")("@actions/core"); +/***/ }), + +/***/ 147: +/***/ ((module) => { + +"use strict"; +module.exports = require("fs"); + /***/ }) -/******/ }); +/******/ }); /************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __nccwpck_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __nccwpck_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ var threw = true; +/******/ try { +/******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__); +/******/ threw = false; +/******/ } finally { +/******/ if(threw) delete __webpack_module_cache__[moduleId]; +/******/ } +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; /******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ var threw = true; -/******/ try { -/******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__); -/******/ threw = false; -/******/ } finally { -/******/ if(threw) delete __webpack_module_cache__[moduleId]; -/******/ } -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ +/******/ /************************************************************************/ -/******/ /* webpack/runtime/compat */ -/******/ -/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/"; -/******/ +/******/ /* webpack/runtime/compat */ +/******/ +/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/"; +/******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. (() => { - -// EXTERNAL MODULE: ../../.volta/tools/image/packages/@vercel/ncc/lib/node_modules/@vercel/ncc/dist/ncc/@@notfound.js?@actions/core -var core = __nccwpck_require__(889); -;// CONCATENATED MODULE: external "fs" -const external_fs_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("fs"); -;// CONCATENATED MODULE: ./index.js - - +const { exportVariable, setFailed } = __nccwpck_require__(889); +const { readFileSync } = __nccwpck_require__(147); try { - const context = JSON.parse((0,external_fs_namespaceObject.readFileSync)(process.env.GITHUB_EVENT_PATH)); + const context = JSON.parse(readFileSync(process.env.GITHUB_EVENT_PATH)); const branch = context.pull_request.head.ref; - (0,core.exportVariable)("SOURCE_BRANCH", branch); + exportVariable("SOURCE_BRANCH", branch); } catch (err) { - (0,core.setFailed)(err.message); + setFailed(err.message); } })(); +module.exports = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/index.js b/index.js index 815f2ef..fd0bc15 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ -import { exportVariable, setFailed } from "@actions/core"; -import { readFileSync } from "fs"; +const { exportVariable, setFailed } = require("@actions/core"); +const { readFileSync } = require("fs"); try { const context = JSON.parse(readFileSync(process.env.GITHUB_EVENT_PATH)); diff --git a/package.json b/package.json index 8f46e78..217d931 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,6 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, - "type": "module", "repository": { "type": "git", "url": "git+https://github.com/JS-Jake/get-pr-source-branch.git"