mirror of
https://github.com/kiegroup/git-backporting.git
synced 2025-07-18 12:38:26 +02:00
project setup
This commit is contained in:
commit
05d156a5b0
39 changed files with 14823 additions and 0 deletions
24
build/src/service/git/github/octokit-factory.js
Normal file
24
build/src/service/git/github/octokit-factory.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const logger_service_factory_1 = __importDefault(require("../../../service/logger/logger-service-factory"));
|
||||
const rest_1 = require("@octokit/rest");
|
||||
/**
|
||||
* Singleton factory class for {Octokit} instance
|
||||
*/
|
||||
class OctokitFactory {
|
||||
static getOctokit(token) {
|
||||
if (!OctokitFactory.octokit) {
|
||||
OctokitFactory.logger.info("Creating octokit instance..");
|
||||
OctokitFactory.octokit = new rest_1.Octokit({
|
||||
auth: token,
|
||||
userAgent: "lampajr/backporting"
|
||||
});
|
||||
}
|
||||
return OctokitFactory.octokit;
|
||||
}
|
||||
}
|
||||
exports.default = OctokitFactory;
|
||||
OctokitFactory.logger = logger_service_factory_1.default.getLogger();
|
Loading…
Add table
Add a link
Reference in a new issue