mirror of
https://github.com/kiegroup/git-backporting.git
synced 2025-07-06 17:43:48 +00:00
feat: config file as option (#42)
Fix https://github.com/lampajr/backporting/issues/37 This enhancement required a huge refactoring where all arguments defaults have been centralized in one single place ArgsParser#parse
This commit is contained in:
parent
a88adeec35
commit
5ead31f606
27 changed files with 1465 additions and 219 deletions
|
@ -14,7 +14,7 @@ export default class GitHubClient implements GitClient {
|
|||
private octokit: Octokit;
|
||||
private mapper: GitHubMapper;
|
||||
|
||||
constructor(token: string, apiUrl: string) {
|
||||
constructor(token: string | undefined, apiUrl: string) {
|
||||
this.apiUrl = apiUrl;
|
||||
this.logger = LoggerServiceFactory.getLogger();
|
||||
this.octokit = OctokitFactory.getOctokit(token, this.apiUrl);
|
||||
|
@ -23,6 +23,14 @@ export default class GitHubClient implements GitClient {
|
|||
|
||||
// READ
|
||||
|
||||
getDefaultGitUser(): string {
|
||||
return "GitHub";
|
||||
}
|
||||
|
||||
getDefaultGitEmail(): string {
|
||||
return "noreply@github.com";
|
||||
}
|
||||
|
||||
async getPullRequest(owner: string, repo: string, prNumber: number): Promise<GitPullRequest> {
|
||||
this.logger.info(`Getting pull request ${owner}/${repo}/${prNumber}.`);
|
||||
const { data } = await this.octokit.rest.pulls.get({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue