mirror of
https://github.com/kiegroup/git-backporting.git
synced 2025-07-06 17:43:48 +00:00
feat(gh-85): take git tokens from environment (#88)
This commit is contained in:
parent
aac73bf7c5
commit
70da575afc
17 changed files with 456 additions and 24 deletions
|
@ -11,16 +11,22 @@ export default class GitHubClient implements GitClient {
|
|||
|
||||
private logger: LoggerService;
|
||||
private apiUrl: string;
|
||||
private isForCodeberg: boolean;
|
||||
private octokit: Octokit;
|
||||
private mapper: GitHubMapper;
|
||||
|
||||
constructor(token: string | undefined, apiUrl: string) {
|
||||
constructor(token: string | undefined, apiUrl: string, isForCodeberg = false) {
|
||||
this.apiUrl = apiUrl;
|
||||
this.isForCodeberg = isForCodeberg;
|
||||
this.logger = LoggerServiceFactory.getLogger();
|
||||
this.octokit = OctokitFactory.getOctokit(token, this.apiUrl);
|
||||
this.mapper = new GitHubMapper();
|
||||
}
|
||||
|
||||
getClientType(): GitClientType {
|
||||
return this.isForCodeberg ? GitClientType.CODEBERG : GitClientType.GITHUB;
|
||||
}
|
||||
|
||||
// READ
|
||||
|
||||
getDefaultGitUser(): string {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue