Skip to content

Commit 028e7ad

Browse files
committed
Dont be an ESModule
1 parent 2e33d24 commit 028e7ad

File tree

3 files changed

+54
-50
lines changed

3 files changed

+54
-50
lines changed

dist/index.js

Lines changed: 52 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,76 @@
1-
import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module";
2-
/******/ var __webpack_modules__ = ({
1+
/******/ (() => { // webpackBootstrap
2+
/******/ var __webpack_modules__ = ({
33

44
/***/ 889:
55
/***/ ((module) => {
66

77
module.exports = eval("require")("@actions/core");
88

99

10+
/***/ }),
11+
12+
/***/ 147:
13+
/***/ ((module) => {
14+
15+
"use strict";
16+
module.exports = require("fs");
17+
1018
/***/ })
1119

12-
/******/ });
20+
/******/ });
1321
/************************************************************************/
14-
/******/ // The module cache
15-
/******/ var __webpack_module_cache__ = {};
16-
/******/
17-
/******/ // The require function
18-
/******/ function __nccwpck_require__(moduleId) {
19-
/******/ // Check if module is in cache
20-
/******/ var cachedModule = __webpack_module_cache__[moduleId];
21-
/******/ if (cachedModule !== undefined) {
22-
/******/ return cachedModule.exports;
22+
/******/ // The module cache
23+
/******/ var __webpack_module_cache__ = {};
24+
/******/
25+
/******/ // The require function
26+
/******/ function __nccwpck_require__(moduleId) {
27+
/******/ // Check if module is in cache
28+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
29+
/******/ if (cachedModule !== undefined) {
30+
/******/ return cachedModule.exports;
31+
/******/ }
32+
/******/ // Create a new module (and put it into the cache)
33+
/******/ var module = __webpack_module_cache__[moduleId] = {
34+
/******/ // no module.id needed
35+
/******/ // no module.loaded needed
36+
/******/ exports: {}
37+
/******/ };
38+
/******/
39+
/******/ // Execute the module function
40+
/******/ var threw = true;
41+
/******/ try {
42+
/******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__);
43+
/******/ threw = false;
44+
/******/ } finally {
45+
/******/ if(threw) delete __webpack_module_cache__[moduleId];
46+
/******/ }
47+
/******/
48+
/******/ // Return the exports of the module
49+
/******/ return module.exports;
2350
/******/ }
24-
/******/ // Create a new module (and put it into the cache)
25-
/******/ var module = __webpack_module_cache__[moduleId] = {
26-
/******/ // no module.id needed
27-
/******/ // no module.loaded needed
28-
/******/ exports: {}
29-
/******/ };
30-
/******/
31-
/******/ // Execute the module function
32-
/******/ var threw = true;
33-
/******/ try {
34-
/******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__);
35-
/******/ threw = false;
36-
/******/ } finally {
37-
/******/ if(threw) delete __webpack_module_cache__[moduleId];
38-
/******/ }
39-
/******/
40-
/******/ // Return the exports of the module
41-
/******/ return module.exports;
42-
/******/ }
43-
/******/
51+
/******/
4452
/************************************************************************/
45-
/******/ /* webpack/runtime/compat */
46-
/******/
47-
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/";
48-
/******/
53+
/******/ /* webpack/runtime/compat */
54+
/******/
55+
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
56+
/******/
4957
/************************************************************************/
5058
var __webpack_exports__ = {};
5159
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
5260
(() => {
53-
54-
// EXTERNAL MODULE: ../../.volta/tools/image/packages/@vercel/ncc/lib/node_modules/@vercel/ncc/dist/ncc/@@notfound.js?@actions/core
55-
var core = __nccwpck_require__(889);
56-
;// CONCATENATED MODULE: external "fs"
57-
const external_fs_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("fs");
58-
;// CONCATENATED MODULE: ./index.js
59-
60-
61+
const { exportVariable, setFailed } = __nccwpck_require__(889);
62+
const { readFileSync } = __nccwpck_require__(147);
6163

6264
try {
63-
const context = JSON.parse((0,external_fs_namespaceObject.readFileSync)(process.env.GITHUB_EVENT_PATH));
65+
const context = JSON.parse(readFileSync(process.env.GITHUB_EVENT_PATH));
6466
const branch = context.pull_request.head.ref;
65-
(0,core.exportVariable)("SOURCE_BRANCH", branch);
67+
exportVariable("SOURCE_BRANCH", branch);
6668
} catch (err) {
67-
(0,core.setFailed)(err.message);
69+
setFailed(err.message);
6870
}
6971

7072
})();
7173

74+
module.exports = __webpack_exports__;
75+
/******/ })()
76+
;

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { exportVariable, setFailed } from "@actions/core";
2-
import { readFileSync } from "fs";
1+
const { exportVariable, setFailed } = require("@actions/core");
2+
const { readFileSync } = require("fs");
33

44
try {
55
const context = JSON.parse(readFileSync(process.env.GITHUB_EVENT_PATH));

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1"
88
},
9-
"type": "module",
109
"repository": {
1110
"type": "git",
1211
"url": "git+https://github.com/JS-Jake/get-pr-source-branch.git"

0 commit comments

Comments
 (0)