mirror of
https://github.com/actions/github-script.git
synced 2026-02-08 03:57:27 +00:00
Revert changes to tsc/ncc
This commit is contained in:
parent
9a58186a54
commit
5d879b69aa
4 changed files with 91 additions and 95 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -1,3 +1 @@
|
||||||
.DS_Store
|
node_modules
|
||||||
node_modules/
|
|
||||||
lib/
|
|
||||||
178
dist/index.js
vendored
178
dist/index.js
vendored
|
|
@ -34,7 +34,7 @@ module.exports =
|
||||||
/******/ // the startup function
|
/******/ // the startup function
|
||||||
/******/ function startup() {
|
/******/ function startup() {
|
||||||
/******/ // Load entry module and return exports
|
/******/ // Load entry module and return exports
|
||||||
/******/ return __webpack_require__(605);
|
/******/ return __webpack_require__(833);
|
||||||
/******/ };
|
/******/ };
|
||||||
/******/ // initialize runtime
|
/******/ // initialize runtime
|
||||||
/******/ runtime(__webpack_require__);
|
/******/ runtime(__webpack_require__);
|
||||||
|
|
@ -1453,7 +1453,7 @@ module.exports = require("child_process");
|
||||||
|
|
||||||
var net = __webpack_require__(631);
|
var net = __webpack_require__(631);
|
||||||
var tls = __webpack_require__(16);
|
var tls = __webpack_require__(16);
|
||||||
var http = __webpack_require__(876);
|
var http = __webpack_require__(605);
|
||||||
var https = __webpack_require__(211);
|
var https = __webpack_require__(211);
|
||||||
var events = __webpack_require__(614);
|
var events = __webpack_require__(614);
|
||||||
var assert = __webpack_require__(357);
|
var assert = __webpack_require__(357);
|
||||||
|
|
@ -1866,25 +1866,6 @@ module.exports = opts => {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ 169:
|
|
||||||
/***/ (function(module) {
|
|
||||||
|
|
||||||
function webpackEmptyContext(req) {
|
|
||||||
if (typeof req === 'number' && __webpack_require__.m[req])
|
|
||||||
return __webpack_require__(req);
|
|
||||||
try { return require(req) }
|
|
||||||
catch (e) { if (e.code !== 'MODULE_NOT_FOUND') throw e }
|
|
||||||
var e = new Error("Cannot find module '" + req + "'");
|
|
||||||
e.code = 'MODULE_NOT_FOUND';
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
webpackEmptyContext.keys = function() { return []; };
|
|
||||||
webpackEmptyContext.resolve = webpackEmptyContext;
|
|
||||||
module.exports = webpackEmptyContext;
|
|
||||||
webpackEmptyContext.id = 169;
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 190:
|
/***/ 190:
|
||||||
|
|
@ -5187,7 +5168,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
||||||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
||||||
|
|
||||||
var Stream = _interopDefault(__webpack_require__(413));
|
var Stream = _interopDefault(__webpack_require__(413));
|
||||||
var http = _interopDefault(__webpack_require__(876));
|
var http = _interopDefault(__webpack_require__(605));
|
||||||
var Url = _interopDefault(__webpack_require__(835));
|
var Url = _interopDefault(__webpack_require__(835));
|
||||||
var https = _interopDefault(__webpack_require__(211));
|
var https = _interopDefault(__webpack_require__(211));
|
||||||
var zlib = _interopDefault(__webpack_require__(761));
|
var zlib = _interopDefault(__webpack_require__(761));
|
||||||
|
|
@ -7604,7 +7585,7 @@ function hasFirstPage (link) {
|
||||||
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const url = __webpack_require__(835);
|
const url = __webpack_require__(835);
|
||||||
const http = __webpack_require__(876);
|
const http = __webpack_require__(605);
|
||||||
const https = __webpack_require__(211);
|
const https = __webpack_require__(211);
|
||||||
const pm = __webpack_require__(950);
|
const pm = __webpack_require__(950);
|
||||||
let tunnel;
|
let tunnel;
|
||||||
|
|
@ -8336,71 +8317,9 @@ function getPageLinks (link) {
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 605:
|
/***/ 605:
|
||||||
/***/ (function(__unusedmodule, __webpack_exports__, __webpack_require__) {
|
/***/ (function(module) {
|
||||||
|
|
||||||
"use strict";
|
|
||||||
__webpack_require__.r(__webpack_exports__);
|
|
||||||
|
|
||||||
// EXTERNAL MODULE: ./node_modules/@actions/core/lib/core.js
|
|
||||||
var core = __webpack_require__(470);
|
|
||||||
|
|
||||||
// EXTERNAL MODULE: ./node_modules/@actions/github/lib/github.js
|
|
||||||
var lib_github = __webpack_require__(469);
|
|
||||||
|
|
||||||
// CONCATENATED MODULE: ./lib/async-function.js
|
|
||||||
const AsyncFunction = Object.getPrototypeOf(async () => { }).constructor;
|
|
||||||
function callAsyncFunction(args, source) {
|
|
||||||
const fn = new AsyncFunction(...Object.keys(args), source);
|
|
||||||
return fn(...Object.values(args));
|
|
||||||
}
|
|
||||||
|
|
||||||
// CONCATENATED MODULE: ./lib/main.js
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
process.on('unhandledRejection', handleError);
|
|
||||||
main().catch(handleError);
|
|
||||||
async function main() {
|
|
||||||
const token = Object(core.getInput)('github-token', { required: true });
|
|
||||||
const debug = Object(core.getInput)('debug');
|
|
||||||
const userAgent = Object(core.getInput)('user-agent');
|
|
||||||
const previews = Object(core.getInput)('previews');
|
|
||||||
const opts = {};
|
|
||||||
if (debug === 'true')
|
|
||||||
opts.log = console;
|
|
||||||
if (userAgent != null)
|
|
||||||
opts.userAgent = userAgent;
|
|
||||||
if (previews != null)
|
|
||||||
opts.previews = previews.split(',');
|
|
||||||
const github = new lib_github.GitHub(token, opts);
|
|
||||||
const script = Object(core.getInput)('script', { required: true });
|
|
||||||
// Using property/value shorthand on `require` (e.g. `{require}`) causes compilatin errors.
|
|
||||||
const result = await callAsyncFunction({ require: __webpack_require__(169), github, context: lib_github.context, core: core }, script);
|
|
||||||
let encoding = Object(core.getInput)('result-encoding');
|
|
||||||
encoding = encoding ? encoding : 'json';
|
|
||||||
let output;
|
|
||||||
switch (encoding) {
|
|
||||||
case 'json':
|
|
||||||
output = JSON.stringify(result);
|
|
||||||
break;
|
|
||||||
case 'string':
|
|
||||||
output = String(result);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new Error('"result-encoding" must be either "string" or "json"');
|
|
||||||
}
|
|
||||||
Object(core.setOutput)('result', output);
|
|
||||||
}
|
|
||||||
function handleError(err) {
|
|
||||||
console.error(err);
|
|
||||||
if (err && err.message) {
|
|
||||||
Object(core.setFailed)(err.message);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Object(core.setFailed)(`Unhandled error: ${err}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
module.exports = require("http");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|
@ -9340,6 +9259,75 @@ function sync (path, options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 833:
|
||||||
|
/***/ (function(__unusedmodule, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
|
||||||
|
// EXTERNAL MODULE: ./node_modules/@actions/core/lib/core.js
|
||||||
|
var core = __webpack_require__(470);
|
||||||
|
|
||||||
|
// EXTERNAL MODULE: ./node_modules/@actions/github/lib/github.js
|
||||||
|
var lib_github = __webpack_require__(469);
|
||||||
|
|
||||||
|
// CONCATENATED MODULE: ./src/async-function.ts
|
||||||
|
const AsyncFunction = Object.getPrototypeOf(async () => { }).constructor;
|
||||||
|
function callAsyncFunction(args, source) {
|
||||||
|
const fn = new AsyncFunction(...Object.keys(args), source);
|
||||||
|
return fn(...Object.values(args));
|
||||||
|
}
|
||||||
|
|
||||||
|
// CONCATENATED MODULE: ./src/main.ts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
process.on('unhandledRejection', handleError);
|
||||||
|
main().catch(handleError);
|
||||||
|
async function main() {
|
||||||
|
const token = Object(core.getInput)('github-token', { required: true });
|
||||||
|
const debug = Object(core.getInput)('debug');
|
||||||
|
const userAgent = Object(core.getInput)('user-agent');
|
||||||
|
const previews = Object(core.getInput)('previews');
|
||||||
|
const opts = {};
|
||||||
|
if (debug === 'true')
|
||||||
|
opts.log = console;
|
||||||
|
if (userAgent != null)
|
||||||
|
opts.userAgent = userAgent;
|
||||||
|
if (previews != null)
|
||||||
|
opts.previews = previews.split(',');
|
||||||
|
const github = new lib_github.GitHub(token, opts);
|
||||||
|
const script = Object(core.getInput)('script', { required: true });
|
||||||
|
// Using property/value shorthand on `require` (e.g. `{require}`) causes compilatin errors.
|
||||||
|
const result = await callAsyncFunction({ require: __webpack_require__(875), github, context: lib_github.context, core: core }, script);
|
||||||
|
let encoding = Object(core.getInput)('result-encoding');
|
||||||
|
encoding = encoding ? encoding : 'json';
|
||||||
|
let output;
|
||||||
|
switch (encoding) {
|
||||||
|
case 'json':
|
||||||
|
output = JSON.stringify(result);
|
||||||
|
break;
|
||||||
|
case 'string':
|
||||||
|
output = String(result);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new Error('"result-encoding" must be either "string" or "json"');
|
||||||
|
}
|
||||||
|
Object(core.setOutput)('result', output);
|
||||||
|
}
|
||||||
|
function handleError(err) {
|
||||||
|
console.error(err);
|
||||||
|
if (err && err.message) {
|
||||||
|
Object(core.setFailed)(err.message);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Object(core.setFailed)(`Unhandled error: ${err}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 835:
|
/***/ 835:
|
||||||
|
|
@ -23621,10 +23609,22 @@ module.exports = function (str) {
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 876:
|
/***/ 875:
|
||||||
/***/ (function(module) {
|
/***/ (function(module) {
|
||||||
|
|
||||||
module.exports = require("http");
|
function webpackEmptyContext(req) {
|
||||||
|
if (typeof req === 'number' && __webpack_require__.m[req])
|
||||||
|
return __webpack_require__(req);
|
||||||
|
try { return require(req) }
|
||||||
|
catch (e) { if (e.code !== 'MODULE_NOT_FOUND') throw e }
|
||||||
|
var e = new Error("Cannot find module '" + req + "'");
|
||||||
|
e.code = 'MODULE_NOT_FOUND';
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
webpackEmptyContext.keys = function() { return []; };
|
||||||
|
webpackEmptyContext.resolve = webpackEmptyContext;
|
||||||
|
module.exports = webpackEmptyContext;
|
||||||
|
webpackEmptyContext.id = 875;
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc && ncc build lib/main.js",
|
"build": "ncc build src/main.ts",
|
||||||
"test": "jest"
|
"test": "jest"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es2018",
|
"target": "es2018",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"outDir": "./lib", /* Redirect output structure to the directory. */
|
|
||||||
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"forceConsistentCasingInFileNames": true
|
"forceConsistentCasingInFileNames": true
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue