2022-11-04 00:55:07 +08:00
|
|
|
"use strict";
|
|
|
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
|
|
if (k2 === undefined) k2 = k;
|
2023-10-26 04:27:07 +08:00
|
|
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
|
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
|
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
|
|
}
|
|
|
|
Object.defineProperty(o, k2, desc);
|
2022-11-04 00:55:07 +08:00
|
|
|
}) : (function(o, m, k, k2) {
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
o[k2] = m[k];
|
|
|
|
}));
|
|
|
|
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
|
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
|
|
}) : function(o, v) {
|
|
|
|
o["default"] = v;
|
|
|
|
});
|
|
|
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
|
if (mod && mod.__esModule) return mod;
|
|
|
|
var result = {};
|
2023-10-26 04:27:07 +08:00
|
|
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
2022-11-04 00:55:07 +08:00
|
|
|
__setModuleDefault(result, mod);
|
|
|
|
return result;
|
|
|
|
};
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
exports.getOctokit = exports.context = void 0;
|
|
|
|
const Context = __importStar(require("./context"));
|
|
|
|
const utils_1 = require("./utils");
|
|
|
|
exports.context = new Context.Context();
|
|
|
|
/**
|
|
|
|
* Returns a hydrated octokit ready to use for GitHub Actions
|
|
|
|
*
|
|
|
|
* @param token the repo PAT or GITHUB_TOKEN
|
|
|
|
* @param options other options to set
|
|
|
|
*/
|
2023-10-26 04:27:07 +08:00
|
|
|
function getOctokit(token, options, ...additionalPlugins) {
|
|
|
|
const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins);
|
|
|
|
return new GitHubWithPlugins((0, utils_1.getOctokitOptions)(token, options));
|
2022-11-04 00:55:07 +08:00
|
|
|
}
|
|
|
|
exports.getOctokit = getOctokit;
|
|
|
|
//# sourceMappingURL=github.js.map
|